Objective
Normally, Windows comes with a WiFi connection, but in order to give the user a better experience, or sometimes need to detect the WiFi status, it needs to be integrated into the project's state.
Principle
1, Microsoft comes with native Wifi API, but in C + +.
2, already has the great God in C # encapsulates the native Wifi API, so C # development based on the package, address: http://managedwifi.codeplex.com/
3, before the connection needs to configure the WLAN profile, if the connection fails, you want to delete the configuration.
4. You can also use the cmd command
To delete a configuration file
At the command prompt, type:
Netsh wlan delete profile name= "ProfileName"
Show all wireless profiles on your PC
At the command prompt, type:
Netsh wlan show profiles
Show security key
At the command prompt, type:
Netsh wlan show profile name= "ProfileName" key=clear
Stop automatically connecting to out-of-range networks
At the command prompt, type:
Netsh wlan set profileparameter name= "ProfileName" connectionmode=manual (auto-fill Auto)
Realize
1. WiFi List tooltip display details
2. Sort by signal strength
3. Connection Status Display
Specific code used in the project comments are very clear
Link: Http://pan.baidu.com/s/1eQlhH9S Password: 2alj
Reference:
Wlan_profile Schema Elements https://msdn.microsoft.com/zh-cn/library/ms706965
Native Wifi https://msdn.microsoft.com/en-us/library/ms706556 (v=vs.85). aspx
Wireless Profile Samples https://msdn.microsoft.com/zh-cn/library/aa369853
Managing Wireless network Profiles Http://windows.microsoft.com/zh-cn/windows-8/manage-wireless-network-profiles
C # implementing WiFi connector