473,785 Members | 2,312 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 2072
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
20799
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
4986
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
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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
10147
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...
1
10083
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
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
5379
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...
1
4044
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
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
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.