Jump to content

How to disconnect/connect the Network


Recommended Posts

QUOTE(Cool-LV @ Nov 8 2007, 04:55 AM)

Hello All,

I wanna disconnet/connect the network with LV, call with API or .net to realize ? Please help to give a tip or thread, thanks in advance.

Can you be more specific about your problem?

Do you want to disable the network interface on the computer, or do you want to change computer IP settings, or do you want to break a TCP connection, or ...

/J

Link to comment

Assuming you work in Windows, and you want to map/unmap network drives dynamically.

It can be done quit easily

through the command prompt using the 'net use' commands. type 'net use /?'

here some examples :

<BR>example to connect :net use T \\companyserver\measurementdatashare mypassword /USER:mydomain\myaccountexample to disconnect drivemap above : net use T \DELETE

Success,

Tom

Link to comment

thanks all,

and Sorry for the not clear question, OS is WinXP, the function that simulate open the local connection status, and press disable network, and press enable to enable the network, thanks

upwards guy's suggestion that I haven't tried, because I see it needs user password to connect, should any tip be easier ?

Link to comment

QUOTE(Cool-LV @ Nov 14 2007, 09:13 PM)

thanks all,

and Sorry for the not clear question, OS is WinXP, the function that simulate open the local connection status, and press disable network, and press enable to enable the network, thanks

upwards guy's suggestion that I haven't tried, because I see it needs user password to connect, should any tip be easier ?

Well, it's not getting much clearer, but if the password is the only problem you are having, that is only required for remote shares that have a password defined. If it is a share that is open for anyone to read, you wouldn't need the password to connect to it. For a share that is password protected, their is no way to connect to it without password.

Rolf Kalbermatter

Link to comment

QUOTE(Cool-LV @ Nov 14 2007, 07:13 PM)

and Sorry for the not clear question, OS is WinXP, the function that simulate open the local connection status, and press disable network, and press enable to enable the network, thanks

upwards guy's suggestion that I haven't tried, because I see it needs user password to connect, should any tip be easier ?

Like rolfk said, it's still really hard to understand what you're trying to do. If you want to map/unmap network drives (with or without password) the other suggestion above is a good one.

If you're trying to access information about network adapters in the system, you can do that with the ipconfig command:

C:\>ipconfig /?USAGE:	ipconfig [/? | /all | /renew [adapter] | /release [adapter] |			  /flushdns | /displaydns | /registerdns |			  /showclassid adapter |			  /setclassid adapter [classid] ]...etc...

Link to comment

QUOTE(Cool-LV @ Nov 20 2007, 01:47 AM)

OK, attached a Picture to tell details, the function is as the sam as press the disable button to diable connection, and press enable to reconnect it. thanks @!

The post before your post explains that exactly. ipconfig can do that too. ipconfig /release [adapter name] will basically disable the network interface. ipconfig /renew [adapter name] will reconnect it.

Of course there is certainly a way to do this accessing the Windows API, but the network enumeration API uses data structures that you most probably do not want to deal with in the Call Library Node, believe me.

Rolf Kalbermatter

Link to comment

QUOTE(rolfk @ Nov 20 2007, 09:15 AM)

The post before your post explains that exactly. ipconfig can do that too. ipconfig /release [adapter name] will basically disable the network interface. ipconfig /renew [adapter name] will reconnect it.

Of course there is certainly a way to do this accessing the Windows API, but the network enumeration API uses data structures that you most probably do not want to deal with in the Call Library Node, believe me.

Rolf Kalbermatter

Well, thanks all and Rolfk

Link to comment

QUOTE(rolfk @ Nov 20 2007, 09:15 AM)

The post before your post explains that exactly. ipconfig can do that too. ipconfig /release [adapter name] will basically disable the network interface. ipconfig /renew [adapter name] will reconnect it.

Of course there is certainly a way to do this accessing the Windows API, but the network enumeration API uses data structures that you most probably do not want to deal with in the Call Library Node, believe me.

Rolf Kalbermatter

Well, thanks all and Rolfk

Link to comment

QUOTE(rolfk @ Nov 20 2007, 10:15 AM)

The post before your post explains that exactly. ipconfig can do that too. ipconfig /release [adapter name] will basically disable the network interface. ipconfig /renew [adapter name] will reconnect it.

Cool-LV,

just note that Rolf's suggestion of using the ipconfig /release and /renew, is not working if your network cars are configured using static IP addresses, i.e. they must be configured to use DHCP.

Good luck!

/J

Link to comment

QUOTE(rolfk @ Nov 20 2007, 10:15 AM)

The post before your post explains that exactly. ipconfig can do that too. ipconfig /release [adapter name] will basically disable the network interface. ipconfig /renew [adapter name] will reconnect it.

Cool-LV,

just note that Rolf's suggestion of using the ipconfig /release and /renew, is not working if your network cars are configured using static IP addresses, i.e. they must be configured to use DHCP.

Good luck!

/J

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.