Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using C# or Powershell to scan all available wireless networks and connect to a specific SSID

I am trying to write a script that scans all the available wireless networks and connects to a specific network (SSID). Does anyone have a sample code written already for this? I cannot install a third party software (managed wifi api) due to some restrictions.

like image 310
Nikhil Chordia Avatar asked Nov 04 '22 17:11

Nikhil Chordia


2 Answers

Check this related article: Managing wireless network connection in C# . There are some answers, as well as a link to a sample app on codeproject that connects and shows basic wireless info (signal strength, etc) using a UI.

like image 63
Egor Avatar answered Nov 15 '22 06:11

Egor


You can use netsh:

netsh wlan connect ssid=YOURSSID name=PROFILENAME

http://www.hanselman.com/blog/HowToConnectToAWirelessWIFINetworkFromTheCommandLineInWindows7.aspx

like image 33
manojlds Avatar answered Nov 15 '22 07:11

manojlds