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
myNetworkConnec tion.IsConnecte d, where myNetworkConnec tion is associated with
some adapter. Not sure if you can wait for this though.
Anyway... hope this helps,
Paul
"dotNetDave " wrote:
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)
"Paul Daly (MCP)" wrote:
Does this help?
http://www.codeproject.com/csharp/CsTCPIPWMI.asp
"dotNetDave " wrote:
I just discovered that this:
Dim searcher As New Management.Mana gementObjectSea rcher("SELECT
NetConnectionSt atus FROM Win32_NetworkAd apter")
For Each networkAdapter As Management.Mana gementObject 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