T
Toby Webb
Hi, can anyone help please?
I am trying to get infromation from my wireless card, such as signal
strength and a list of SSIDs that it can see. I have been able to get
the signal strength (see code below), but I cannot get the list of
SSIDs. I have installed WMITools (from Microsoft) to delve in further
and it tells me that there is no instance for MSNdis_80211_WLanBssId
or MSNdis_80211_BSSIList.
The code I used to get the signal strength is below:
----------------------------------------------------------------------------
ListBox2.Items.Clear()
Dim query As Management.ManagementObjectSearcher
Dim Qc As Management.ManagementObjectCollection
Dim Oq As Management.ObjectQuery
Dim Ms As Management.ManagementScope
Dim Co As Management.ConnectionOptions
Dim Mo As Management.ManagementObject
Dim signalStrength As String
Try
Co = New Management.ConnectionOptions
Ms = New Management.ManagementScope("root\wmi")
Oq = New Management.ObjectQuery("SELECT * FROM
MSNdis_80211_ReceivedSignalStrength Where active=true")
query = New Management.ManagementObjectSearcher(Ms, Oq)
Qc = query.Get
signalStrength = 0
For Each Mo In query.Get
signalStrength = Mo("Ndis80211ReceivedSignalStrength")
ListBox2.Items.Add(signalStrength)
Next
Catch exp As Exception
' Indicate no signal
signalStrength = -1
End Try
----------------------------------------------------------------------------
I have tried to use the same code but replacing the signal strength
table with the others I have mentioned but it returns no results
(instances). Can anyone please explain why, and if there is a way
around this?
I am using Win XP SP2.
Thanks in advance,
Toby.
I am trying to get infromation from my wireless card, such as signal
strength and a list of SSIDs that it can see. I have been able to get
the signal strength (see code below), but I cannot get the list of
SSIDs. I have installed WMITools (from Microsoft) to delve in further
and it tells me that there is no instance for MSNdis_80211_WLanBssId
or MSNdis_80211_BSSIList.
The code I used to get the signal strength is below:
----------------------------------------------------------------------------
ListBox2.Items.Clear()
Dim query As Management.ManagementObjectSearcher
Dim Qc As Management.ManagementObjectCollection
Dim Oq As Management.ObjectQuery
Dim Ms As Management.ManagementScope
Dim Co As Management.ConnectionOptions
Dim Mo As Management.ManagementObject
Dim signalStrength As String
Try
Co = New Management.ConnectionOptions
Ms = New Management.ManagementScope("root\wmi")
Oq = New Management.ObjectQuery("SELECT * FROM
MSNdis_80211_ReceivedSignalStrength Where active=true")
query = New Management.ManagementObjectSearcher(Ms, Oq)
Qc = query.Get
signalStrength = 0
For Each Mo In query.Get
signalStrength = Mo("Ndis80211ReceivedSignalStrength")
ListBox2.Items.Add(signalStrength)
Next
Catch exp As Exception
' Indicate no signal
signalStrength = -1
End Try
----------------------------------------------------------------------------
I have tried to use the same code but replacing the signal strength
table with the others I have mentioned but it returns no results
(instances). Can anyone please explain why, and if there is a way
around this?
I am using Win XP SP2.
Thanks in advance,
Toby.