G
Guest
Hi,
I am trying to query a WiFi card to get signal strength. I am looking at WMI as a solution however I cannot access the MSNdis_80211_ReceivedSignalStrength namespace on windows 2000 professional (SP3) machine. I have downloaded the WMI tools and cannot see this namespace in the studion (under root\wmi or root\ nor root\cimv2). I have tried the following sample but get "Invalid class" when trying to access the result
Public Function GetSignalStrength() As String
On Error GoTo oops
Dim query As ManagementObjectSearcher
Dim Qc As ManagementObjectCollection
Dim Oq As ObjectQuery
Dim Ms As ManagementScope
Dim Co As ConnectionOptions
Dim Mo As ManagementObject
Dim outp As String
Co = New ConnectionOptions
//I have also tried ("\\MyServer\root\wmi")
Ms = New ManagementScope("\\MyServer\root\cimv2")
Oq = New ObjectQuery("SELECT * FROM MSNdis_80211_ReceivedSignalStrength Where active=true")
query = New ManagementObjectSearcher(Ms, Oq)
Qc = query.Get
outp = ""
For Each Mo In query.Get
outp = outp & Mo("Ndis80211ReceivedSignalStrength") & " "
ISIPActive = Mo("Active")
Next
Return Trim(outp)
Exit Function
oops:
Return Err.Description
End Function
The error I get is
System.Management.ManagementException: Invalid class
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectEnumerator.MoveNext()
at test.WifiStrength.GetSignalStrength()
I would appreciate some help on this, I am using a D-Link USB wireless card.
Michael
I am trying to query a WiFi card to get signal strength. I am looking at WMI as a solution however I cannot access the MSNdis_80211_ReceivedSignalStrength namespace on windows 2000 professional (SP3) machine. I have downloaded the WMI tools and cannot see this namespace in the studion (under root\wmi or root\ nor root\cimv2). I have tried the following sample but get "Invalid class" when trying to access the result
Public Function GetSignalStrength() As String
On Error GoTo oops
Dim query As ManagementObjectSearcher
Dim Qc As ManagementObjectCollection
Dim Oq As ObjectQuery
Dim Ms As ManagementScope
Dim Co As ConnectionOptions
Dim Mo As ManagementObject
Dim outp As String
Co = New ConnectionOptions
//I have also tried ("\\MyServer\root\wmi")
Ms = New ManagementScope("\\MyServer\root\cimv2")
Oq = New ObjectQuery("SELECT * FROM MSNdis_80211_ReceivedSignalStrength Where active=true")
query = New ManagementObjectSearcher(Ms, Oq)
Qc = query.Get
outp = ""
For Each Mo In query.Get
outp = outp & Mo("Ndis80211ReceivedSignalStrength") & " "
ISIPActive = Mo("Active")
Next
Return Trim(outp)
Exit Function
oops:
Return Err.Description
End Function
The error I get is
System.Management.ManagementException: Invalid class
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectEnumerator.MoveNext()
at test.WifiStrength.GetSignalStrength()
I would appreciate some help on this, I am using a D-Link USB wireless card.
Michael