473,795 Members | 3,295 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.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
Nov 22 '05 #1
6 2073
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

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

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

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

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

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

Nov 22 '05 #7

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

Similar topics

11
20800
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, but as it stands now, there's no code to detect if there is in fact a network connection available before I try sending. Is there some easy way to do this? Thanks,
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 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!
3
4987
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 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!
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6780
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2920
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.