Specific embodiment
Below in conjunction with attached drawing, invention is further described in detail.
Referring to Fig. 1, a kind of computer 100 includes network interface 102, storage unit 104, priority setting unit 106, detection
Unit 108 and network settings unit 110.
Network interface 105 is established for grafting cable and other equipment and is communicated to connect.
Storage unit 104 is stored with the IP address information for many netting twines that can be connect with computer 100.The IP address information
IP address information including a static ip address and a local area network.The static ip address is not in the network segment of local area network.
Priority setting unit 106 is used to be arranged computer 100 preferentially using the IP of static ip address or local area network
Location.
Detection unit 108 is for detecting whether there is cable to be connected in network interface 102.IP address belonging to the cable is that this is quiet
The IP address of state IP address or local area network.
Network settings unit 110 is used for when having detected that cable is connected in network interface 102, uses IP address according to preferential
IP address information in the network attribute of information switching computer 100 is for the IP of static ip address or dynamic acquisition local area network
Location.
Whether the IP address connection that detection unit 108 is also used to detect computer 100 succeeds.
Network settings unit 110 is also used to the network attribute of computer in the IP address connection failure of computer 100
In IP address information be set as the IP address or static ip address of dynamic acquisition local area network.Specifically, when by computer 100
IP address be set as static static ip address after, when the connection of the IP address of computer 100 is unsuccessful, network settings unit 110
Set the IP address of computer 100 to the IP address of dynamic acquisition local area network.When being set as dynamic in 100 IP address of computer
After state obtains the IP address of local area network, when the connection of the IP address of computer 100 is unsuccessful, network settings unit 110 is by computer
100 IP address is set as static ip address.
Referring to Fig. 2, in another embodiment, a kind of computer 200 includes network interface 202, storage unit 204, detection
Unit 206, display unit 208 and network settings unit 210.
Network interface 202 is established for grafting cable and other equipment and is communicated to connect.
Storage unit 204 is for storing the multiple IP address informations that can be connect with computer 200.The IP address information includes
The IP address information of one static ip address and a local area network.The static ip address is not in the network segment of local area network.
Detection unit 206 is for detecting whether there is cable to be connected in network interface 202.IP address belonging to the cable is that this is quiet
The IP address of state IP address or local area network.
Display unit 208, should for showing an IP address set interface when having detected that cable is connected in network interface 202
IP address set interface is to set static ip address for the IP address information in the network attribute of computer 200 for user's selection
Or the IP address of dynamic acquisition local area network.
Network settings unit 210 is used to select the IP address information in the network attribute of setting computer 200 according to user
For the IP address of static ip address or dynamic acquisition local area network.
Whether the IP address connection that detection unit 206 is also used to detect computer 200 succeeds.
Display unit 210 also shows the prompt of IP address connection failure in the IP address connection failure of computer 200, mentions
Awake user reselects the IP address information in network attribute.
Referring to Fig. 3, being a kind of flow chart of network attribute setting method, this method is applied in a computer 100, uses
IP address information in the network attribute of setting computer 100, that the steps included are as follows is described for this method.
Detection unit 108 detects whether that cable is connected in the network interface 102 of computer 100 (step S302).
Computer 100 is arranged preferentially using the IP of a static ip address or a local area network in priority setting unit 106
Location, wherein the static ip address is not in the network segment of local area network (step S304).
Network settings unit 110 uses IP address information when having detected that cable is inserted into network interface 102, according to preferential
The IP address information being arranged in the network attribute of computer is the IP address (step of static ip address or dynamic acquisition local area network
S306).
Whether the IP address connection that detection unit 108 detects computer 100 is successful (step S308).
Network settings unit 110 will be in the network attribute of computer 100 in the IP address connection failure of computer 100
IP address information is switched to the IP address or static ip address (step S310) of dynamic acquisition local area network.
Referring to Fig. 4, in another embodiment, a kind of network attribute setting method is applied in a computer 200, uses
IP address information in the network attribute of setting computer 200, that the steps included are as follows is described for this method.
Detection unit 206 detects whether that cable is connected to (step 402) in the network interface 202 of computer 200.
Display unit 208 shows an IP address set interface when having detected that cable is connected in network interface 202, the IP
Location set interface is to set a static ip address also for the IP address information in the network attribute of computer 200 for user's selection
It is the IP address of one local area network of dynamic acquisition, wherein the static ip address is not in the network segment of local area network (step S404).
It is quiet that network settings unit 210, which selects the IP address information in the network attribute of setting computer 200 according to user,
The IP address of state IP address or dynamic acquisition local area network.(step S406).
Whether the IP address connection that detection unit 206 detects computer 200 is successful (step S408).
Display unit 208 shows the prompt (step of IP address connection failure in the IP address connection failure of computer 200
S410).
Above-mentioned computer and method are automatically performed IP address setting when cable is connected to computer, without artificial setting.
Those skilled in the art it should be appreciated that more than embodiment be intended merely to illustrate the present invention,
And be not used as limitation of the invention, as long as within spirit of the invention, it is to the above embodiments
It is appropriate change and variation all fall in it is disclosed in this invention within the scope of.