Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Display WiFi Networks in VB.net

Hey guys

I'm wanting to display wireless networks in a VB.net list box but only their SSID names.

I've found that 'netsh wlan show networks' is promising an I am executing it like this:

Code
Public Sub ScanNetworks()
        Dim output As String
        Dim proc As New Process()
        proc.StartInfo.CreateNoWindow = True
        proc.StartInfo.FileName = "netsh"
        proc.StartInfo.Arguments = "wlan show networks mode=bssid"
        proc.StartInfo.RedirectStandardOutput = True
        proc.StartInfo.UseShellExecute = False
        ' required for the Redirect setting above Process.Start(proc);
        proc.Start()
        output = proc.StandardOutput.ReadToEnd()
        MsgBox(output)
    End Sub

Problem is netsh will also bring a lot of useless information that I not required for the program I am making. At this point, I'm kind of stumped.

Anyone have any ideas how I can retrieve only the SSID and nothing else?

I've found some resources online about using Substrings to read to the end of a string. Below I'll provide as much information as I can.

This is the output from netsh wlan show networks
Code
netsh wlan>show networks

Interface name : Wireless Network Connection
There are 2 networks currently visible.

SSID 1 : Jackks Room
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : TKIP

All I want is:
Code
SSID 1 : Jackks Room

Obviously I need it too loop through so it will get SSID 1, 2, 3 etc...

Any ideas?

Thanks!
Well you just loop with String.IndexOf("SSID",lastLocation) and read until the new line, until you run out of SSIDs...
Disregard this thread. I found a Native WiFi API that did exactly what I needed.

/Locked


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by CPAManagerFeb 4, 2016 06:38 AM 18 884 Feb 4, 2016 06:38 AM
Last Post: He B TeMy
[Shell] by /{evin Mitnic/{Dec 13, 2014 04:05 AM 13 234 Dec 13, 2014 04:05 AM
Last Post: /{evin Mitnic/{
[.NET] by airplanejoeMar 24, 2014 04:53 AM 7 289 Mar 24, 2014 04:53 AM
Last Post: Venom‎