views:

31

answers:

2

How can I monitor if Ethernet cables are plugged in or not from .NET for a given Ethernet connection?

I would like to enumerate all Ethernet connections and subscribe to any connection status changes. I am not interested in detecting Internet access, only if an Ethernet connection is Connected or Not Connected.

Update: I found this blog post on how to use a WMI query to be notified of disconnections.

+1  A: 

I provided an answer to a similar question yesterday, this may help.

http://stackoverflow.com/questions/3921999/c-get-network-connection-status-and-speed-in-xp/3922056#3922056

kyndigs
+1  A: 

Look at the NetConnectionStatus property of the Win32_NetworkAdapter class.

ho1