Im making a small interface for my Carputer. I have gathered resources across the internet for this project and gotten it to work nicely. The problem is that Im stuck at a part that I can find little help on. I'm hoping that some of my fellow carputer people might be able to help me with.
I have some code that reads Windows XPs WMI for Wireless Networks in the area. The WMI pulls down and then lists the APs SSID in a large text box. The problem is that WMI and my code are pulling down the same AP name multiple times if the AP is in reach, and I need it to only list the AP once.
That will pull down the names like...
Private Sub wifitimer_Timer()
Dim objSwbemServices, colInstances, obj, rawssid, ssid, i, decval
On Error Resume Next
Set objSwbemServices = GetObject("winmgmts:\\.\root\wmi")
Set colInstances = objSwbemServices.ExecQuery("SELECT * FROM MSNDis_80211_BSSIList")
For Each obj In colInstances
If Left(obj.InstanceName, 4) <> "WAN " And Right(obj.InstanceName, 8) <> "Miniport" Then
For Each rawssid In obj.Ndis80211BSSIList
ssid = ""
For i = 0 To UBound(rawssid.Ndis80211Ssid)
decval = rawssid.Ndis80211Ssid(i)
If (decval > 31 And decval < 127) Then
ssid = ssid & Chr(decval)
wifilist.SelStart = Len(wifilist.Text)
wifilist.SelText = ssid & vbCrLf
and so on, can I somehow load this into an array of some sort and take out the duplicates? Thanks.
If anyone needs my entire program for some reason just ask and I will post it.