Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

getting ssid in visual basic

Posted on 2004-10-03
6
Medium Priority
?
1,686 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Introducing the WatchGuard 420 Access Point

WatchGuard's newest access point includes an 802.11ac Wave 2 chipset, providing the fastest speeds for VoIP, video and music streaming, and large data file transfers. Additionally, enjoy the benefits of strong security as the 3rd radio delivers dedicated WIPS protection!

 
LVL 48

Expert Comment

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

Accepted Solution

by:
Mikal613 earned 1500 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
This program is used to assist in finding and resolving common problems with wireless connections.
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…

721 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