Solved

getting ssid in visual basic

Posted on 2004-10-03
6
1,627 Views
Last Modified: 2008-01-09
i am trying to get ssid ... signal strength is working fine but ssid is giving me some problems...
Can anyone go through this code and find what is wrong with it..
i get error like
------------------------------------------------------------
An unhandled exception of type 'System.Management.ManagementException' occurred in system.management.dll

Additional information: Invalid parameter

------------------------------------------------
and error points to second line of given code..
 any help is appreciated...

-----------------------------------------
 Dim mgmntscp As New ObjectGetOptions
        Dim mc As New ManagementClass("root\\WMI", "MSNdis_80211_ServiceSetIdentifier", mgmntscp)
        Dim moc As ManagementObjectCollection
        moc = mc.GetInstances()

        For Each mo As ManagementObject In moc
            'Dim wlanCard As String = CType(mo("InstanceName"), String)
            Dim active As Boolean = CType(mo("Active"), Boolean)
            Dim ssid() As Byte = CType(mo("Ndis80211SsId"), Byte())
            Dim ssidString As String = System.Text.Encoding.ASCII.GetString(ssid)
            MsgBox(ssidString)
        Next mo


0
Comment
Question by:prashanth_gurijala
  • 4
  • 2
6 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 12221927
try
Dim mc As New ManagementClass("root\\WMI", "MSNdis_80211_ServiceSetIdentifier", null)
0
 

Author Comment

by:prashanth_gurijala
ID: 12222011
HI,

Its giving an error

WindowsApplication2\Form1.vb(48): 'null' is not declared. 'Null' constant is no longer supported; use 'System.DBNull' instead.

and i tried System.DBNull but it gives as

Visual Studio Projects\WindowsApplication2\Form1.vb(48): 'DBNull' is a type in 'System' and cannot be used as an expression.

also tried DBNull gets another error

thanx
prashanth
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12222366
what is mo??
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 48

Expert Comment

by:Mikal613
ID: 12222372
got it 4get it
0
 
LVL 48

Accepted Solution

by:
Mikal613 earned 500 total points
ID: 12222845
0
 

Author Comment

by:prashanth_gurijala
ID: 12233234
yeah i am back ffrom  exams.... hey i tried that link too in the beginining and i guess its in c # and i tried converting it into vb but no luck
I am not sure if i can manage C# as its been some 4 years back i was using VC++ .. can we compile that and include as a module i am not sure...
But any advice is appreciated...
thanx
-prashanth
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
This subject  of securing wireless devices conjures up visions of your PC or mobile phone connecting to the Internet through some hotspot at Starbucks. But it is so much more than that. Let’s look at the facts: devices#sthash.eoFY7dic.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question