With this tool you can connect to a Wifi Network using a config file (at Windows Startup for example). Currently the tool only connect to Wifi Networks that are already registered.
The usage is very simple:
- Download the ZIP file from releases and extract it to some folder
- Start the executable (AutoWLAN.exe) for the first time
- Edit the config.json with a text editor of your choice, replace
SSID_HERE
by your Wifi Name (e.q.WLAN-Home
) and set theAutostart
value totrue
if you want it to autostart, orfalse
if you don't. - After that start it again and the settings will be applied. You can change it anytime you want then, but start the exe to apply it!
The entire code is inside Program.cs, the code to connect is in the connect to wifi
region
AccessPoint targetWLAN = null;
Wifi wifi = new Wifi();
foreach (AccessPoint ap in wifi.GetAccessPoints()) //iterating through all wireless profiles
{
if(ap.Name == config.SSID)
{
targetWLAN = ap; //if the right one is found assign it
break;
}
}
if (targetWLAN != null)
{
AuthRequest authRequest = new AuthRequest(targetWLAN);
targetWLAN.Connect(authRequest); //connect
}
- The
Config.cs
class is just the config class I created for Newtonsoft.Json to (de)serialize the config file. It contains the SSID (AP Name) and the autostart bool If the autostart is true, it will be set in the#Set/Remove Autostart
region. - The AccessPoint and Wifi object are both classes from the SimpleWifi Library by DigiExam
-
Clone or download the repository and use
Visual Studio
with.NET Framework
installed to open the solution and build it.or
-
Clone or download the repository and use MSBuild to build it.
(Example:msbuild AutoWLAN.sln /t:Rebuild /p:Configuration=Release /p:Platform="any cpu"
)