Getting Network Connection Status on Win2K

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I just discovered that this:

Dim searcher As New Management.ManagementObjectSearcher("SELECT
NetConnectionStatus FROM Win32_NetworkAdapter")
For Each networkAdapter As Management.ManagementObject In searcher.Get()

does not work on Win2K to get the network connection status! Does anyone
have some samples on how to do this same thing on Win2K?

Thanks!
David

=====================
David McCarter
www.vsdntips.com
 
Okay, this seems to get the IP addresses. Am I to assume that if I find a IP
address then the computer is connected? (I'm not really up on networking)
 
Well... it depends on what level of connectivity you are checking for. If
you find their IP address, then yes... they are connected to a LAN. (Even if
they set their IP address statically, the address shouldn't be returned
unless the connection is live. <- Test this to make sure, but I think that's
how it works.) However, that doens't mean that they are connected to the
Internet. You might want to try pinging their default gateway, or maybe even
some website. It all depends on what you're looking for.

I know that this is much easier in .NET 2.0. I watched an interview of
someone at Microsoft who worked on network programability. It was as easy as
myNetworkConnection.IsConnected, where myNetworkConnection is associated with
some adapter. Not sure if you can wait for this though.

Anyway... hope this helps,

Paul
 
Back
Top