473,795 Members | 3,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get network status through WMI

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
Nov 20 '05 #1
3 4986
Hi,

If you are looking to check network status for an active network
connection. You need to a reference to system.manageme nt.dll for this to
work.

http://msdn.microsoft.com/library/de...connection.asp

Private Sub GetNetworkStatu s()
Dim moReturn As Management.Mana gementObjectCol lection
Dim moSearch As Management.Mana gementObjectSea rcher
Dim mo As Management.Mana gementObject

moSearch = New Management.Mana gementObjectSea rcher("Select * from
Win32_NetworkCo nnection")

moReturn = moSearch.Get
For Each mo In moReturn
Dim strOut As String
strOut = String.Format(" {0} - Status {1}", mo("Name").ToSt ring,
mo("Status").To String)
Trace.WriteLine (strOut)
Next
End Sub

Here is a link to see if you are connected to a network that uses a
ping

http://msdn.microsoft.com/library/de...dunplugged.asp

Ken
--------------------------
"Norton" <no********@hot mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
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

Nov 20 '05 #2
thx a lot ~ it works ~

"Ken Tucker [MVP]" <vb***@bellsout h.net> ¦b¶l¥ó
news:Os******** ******@TK2MSFTN GP12.phx.gbl ¤¤¼¶¼g...
Hi,

If you are looking to check network status for an active network
connection. You need to a reference to system.manageme nt.dll for this to
work.

http://msdn.microsoft.com/library/de...connection.asp
Private Sub GetNetworkStatu s()
Dim moReturn As Management.Mana gementObjectCol lection
Dim moSearch As Management.Mana gementObjectSea rcher
Dim mo As Management.Mana gementObject

moSearch = New Management.Mana gementObjectSea rcher("Select * from
Win32_NetworkCo nnection")

moReturn = moSearch.Get
For Each mo In moReturn
Dim strOut As String
strOut = String.Format(" {0} - Status {1}", mo("Name").ToSt ring, mo("Status").To String)
Trace.WriteLine (strOut)
Next
End Sub

Here is a link to see if you are connected to a network that uses a ping

http://msdn.microsoft.com/library/de...dunplugged.asp
Ken
--------------------------
"Norton" <no********@hot mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
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


Nov 20 '05 #3
Hi I just tried this and I am propably missing something but I can't
get it to work. I belive that the problem is when moSearch.Get is
executed, in the debug output i get the following: "The thread '<No
Name>' (0xc88) has exited with code 0 (0x0)"

Thanks

Jacob

On Thu, 27 May 2004 06:53:40 -0400, "Ken Tucker [MVP]"
<vb***@bellsout h.net> wrote:
Hi,

If you are looking to check network status for an active network
connection. You need to a reference to system.manageme nt.dll for this to
work.

http://msdn.microsoft.com/library/de...connection.asp

Private Sub GetNetworkStatu s()
Dim moReturn As Management.Mana gementObjectCol lection
Dim moSearch As Management.Mana gementObjectSea rcher
Dim mo As Management.Mana gementObject

moSearch = New Management.Mana gementObjectSea rcher("Select * from
Win32_NetworkC onnection")

moReturn = moSearch.Get
For Each mo In moReturn
Dim strOut As String
strOut = String.Format(" {0} - Status {1}", mo("Name").ToSt ring,
mo("Status").T oString)
Trace.WriteLine (strOut)
Next
End Sub

Here is a link to see if you are connected to a network that uses a
ping

http://msdn.microsoft.com/library/de...dunplugged.asp

Ken
--------------------------
"Norton" <no********@hot mail.com> wrote in message
news:%2******* ********@TK2MSF TNGP12.phx.gbl. ..
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


Nov 20 '05 #4

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

Similar topics

0
1112
by: jack | last post by:
Hi, I am looking for a network analyzer like argus. If witten in python it would be easier to customize if need be. It should monitor the status of an ftp server (with each login password), http, https, bandwith, generate graphics and send an alarm as soon as it detects a problem. As a matter of fact, I have already written a small portion to check
1
3358
by: ripken95 | last post by:
I connect to the internet through ADSL. I want to write the web page which can detect the connection status with javascript. This detection is like the signal detection in the mobile phone. If the signal is weak, the status may have one squares or zero on the phone. How could I do if I want to detect the status of the network? Thx and Best Regards.
5
16261
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager."
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!
6
1868
by: Christopher C | last post by:
I am currently working on an app the will be a shell replacement. Part of the goal is to list the current network status; basically I need to know if the network card is plugged in. I am currently using WMI to query all adapters to see if they have a connected status. The status is updated every 30minutes. I noticed this is leaking memory. I am looking for suggestions. I am running this on an asynchronous thread call with callbacks to a...
5
9531
by: Al | last post by:
Hi, Is there any way to detected if a device is connected? How would I query to see the device is connected to network. My application is mobile and mostly on wireless connection but it could be wired as well. Any Help would be appreciated. Regards Al
0
4289
by: BLUE | last post by:
Enable and Disable in the Network and DialUp Connections manager is actually setting a bit in the registry for the target adapter and then calling NDIS to unbind or bind (depending on whether your disabling or enabling the adapter). In HKEY_LOCAL_MACHINE\Comm\NdisPower insert this value to disable the adapter: <adapterNameREG_DWORD 4 (0x00000004)
2
2877
by: =?Utf-8?B?Um9ja3k=?= | last post by:
If the network cable is unplugged I need to change an image on my main form status bar, however this does not work ' The computer has been connected or disconnected from the network If e.IsNetworkAvailable = False Then My.Forms.MainForm.usbtest.Panels(2).Appearance.Image = My.Resources.server_error Else My.Forms.MainForm.usbtest.Panels(2).Appearance.Image = My.Resources.server_ok
0
3783
by: nancylife | last post by:
When developing web report, many developers use VMware to simulate different operating systems on a same server. Then, they can realize cross-platform deployment and debug of web report. According to real application of web report, I will discuss three network setting ways of VMware with all of you. Bridge way This is the simplest way as it bridges the virtual network card to a physical network card directly. It is similar to a network...
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
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...
1
7538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6779
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
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.