Solved

getting ssid in visual basic

Posted on 2004-10-03
6
1,601 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Hopefully this article will help someone who's had the same issues I had. I have a Dell Wireless 1390 WLAN Mini-Card and Windows 7, and for the past couple of days I was beyond frustrated because my wireless laptop was not able to access the Inte…
Today sees the launch of a new case study, focusing on BYOD technologies we have been working with for some time now.  But with the advent of 802.11ac wireless technologies and the story behind our landmark developments, we would like to share this …
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now