Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I measure wifi strength in vb.net
I have this code but it gives me an error saying isipactive is not declared. Please help:
VB
 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
        Ms = New ManagementScope("root\wmi")
        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

Thank you in advance
Posted
Comments
Michael_Davies 14-Mar-15 5:48am    
Have you tried using WMICodeCreator, very useful tool when exploring WMI, helps you to see exactly what is available in any WMI object;

http://www.microsoft.com/en-us/download/details.aspx?id=8572
CHill60 14-Mar-15 10:51am    
Try declaring ISIPActive! Dim ISIPActive As Object for example. You're not actually doing anything with it though
iProgramIt 14-Mar-15 18:11pm    
Then what is the point of it?
iProgramIt 14-Mar-15 18:11pm    
I tried to remove it and the code backfired
CHill60 14-Mar-15 19:52pm    
"Then what is the point of it?" - I don't know ... this is allegedly YOUR code.
"backfired" ... how did you make your code make an unintended explosion? You mean an error was raised ... what was it?
Try to help us to help you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900