Solved

getting ssid in visual basic

Posted on 2004-10-03
6
1,654 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Coaxial cable bending There are several factors that govern the selection of coaxial cable for your Machine to Machine (M2M) application: the location of cable runs, either indoor or outdoor, inside or outside an enclosure, maximum bending and the…
This article is a step by step guide on how to create a basic PTP link using Ubiquiti airOS devices. This guide can be used on the following Ubiquiti AirMAX devices. Nanostation, Bullets, AirBridge, Nanobeam, NanoBridge to name a few. Please review …
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…

752 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