473,498 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting Network Connection Status on Win2K

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
Nov 22 '05 #1
6 2035
Does this help?

http://www.codeproject.com/csharp/CsTCPIPWMI.asp
"dotNetDave" wrote:
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

Nov 22 '05 #2
Does this help?

http://www.codeproject.com/csharp/CsTCPIPWMI.asp
"dotNetDave" wrote:
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

Nov 22 '05 #3
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.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

Nov 22 '05 #4
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.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

Nov 22 '05 #5
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

"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.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

Nov 22 '05 #6
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

"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.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

Nov 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
20748
by: Adam Parkin | last post by:
Hello all, I need to be able to detect if there is an active available Internet connection in my VB6 program. In my program I'm using the Internet Transfer Control to transfer some files by HTTP,...
3
453
by: dotNetDave | last post by:
I just discovered that this: Dim searcher As New Management.ManagementObjectSearcher("SELECT NetConnectionStatus FROM Win32_NetworkAdapter") For Each networkAdapter As...
3
4966
by: Norton | last post by:
Hi all, May i know how to get the network status through WMI, i have searched the WMI properties but cannot find the related property to use. thx in advance Norton
0
274
by: dotNetDave | last post by:
I just discovered that this: Dim searcher As New Management.ManagementObjectSearcher("SELECT NetConnectionStatus FROM Win32_NetworkAdapter") For Each networkAdapter As...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.