Enable/ disable a LAN connection

  • Thread starter Thread starter yyy
  • Start date Start date
Y

yyy

Hello,
Can someone please tell me how can I enable/ disable a LAN connection
using C#.NET?

Thanks in advance :D

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
Win32_NetworkConnection ConnectionState is read-only. You can't change it's
state.
Only thing you can do using WMI is unloading/loading the device driver for
you connection (exactly as the Control pannel Connections applet does when
disabling/enabling).

Willy.
 
It's not clear what exactly you want to achieve.
Do you wan't to disconnect from a remote resource (a file share for
instance), or do you wan't to disconnect a client session from a shared
resource?
Or is it something else?

Willy.
 
My error with the connection state. Thanks Willy.

You can still use interop to disconnect... that is if this what you are
looking for.

Good luck.
 
Brian,

I'm pretty sure the solution is in System.Management (WMI), but first we
have to know exactly what OP is looking for.

Willy.
 
Who is Brian ?

What do you mean by "What OP looking for" ?

I couldn't do it with WMI. Do you have another idea ?

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
Back
Top