Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Managing wireless network connection in C#

We've got a WinForms app written in C# that has a very custom GUI. The user is not allowed to run any other applications and the user cannot go into the OS (WinXP Pro) at all. We're planning on allowing the user to connect to available wireless networks. We're going to have to create a configuration screen that displays available networks (by SSID) and allows the user to connect. While connected we want to display signal strength.

Are there any existing components that provide this capability? I haven't found anything but this.

I can set the TCP/IP settings using WMI, but it's the wireless stuff that I need a direction on.

Many thanks!

Matt

like image 392
user37149 Avatar asked Nov 12 '08 22:11

user37149


People also ask

What is wireless network management?

MTC Communications' wireless network management system includes a high quality router capable of handling all of your in-home devices. The router sorts your in-home device traffic by bandwidth usage, and then it sends data to each device at a speed best suited for the device type.

How do I manage Wi-Fi on my computer?

To access the Wi-Fi settings in Windows 10, users can click the Start button, then Settings, and then Network & Internet. A menu of options will appear on the left. For PCs that rely on wireless network connections, a Wi-Fi entry will be included on the left list.

How can I see all connected Wi-Fi using CMD?

At the command prompt, type netsh wlan show wlanreport. This will generate a wireless network report that's saved as an HTML file, which you can open in your favorite web browser. The report shows all the Wi-Fi events from the last three days and groups them by Wi-Fi connection sessions.


1 Answers

Managed Wifi API should work.

This might not be ideal - you have XP, which is good, but you would have to deploy a hotfix. I'd go for it, because all the wifi code I've dealt with (for the Compact Framework) is hideous. This code is as simple as could be.

Their sample code doesn't include reading the signal strength, though, and I'm not sure if the Native wifi API provides that. I have written C# code that gets the wireless signal strength, but it did this by PInvoking into a manufacturer-specific DLL available only on their devices. It may be that you'll have to do something similar to get the wireless strength from your PC's wireless card (and that may be why that functionality is not available in an all-purpose API).

like image 122
MusiGenesis Avatar answered Oct 05 '22 06:10

MusiGenesis