通常正常状况下都会用windows自带的wifi链接,可是为了给用户更好的体验,或者有时候须要检测wifi状态,仍是须要集成到项目中态。c#
一、微软自带Native Wifi API,不过是用C++的。windows
二、已有大神用c#封装了Native Wifi API,因此c#开发基于该封装,地址:http://managedwifi.codeplex.com/安全
三、链接前须要配置WLAN profile,若是链接失败,则要删除该配置。网络
四、也可使用cmd命令less
删除配置文件
在命令提示符下,键入:
netsh wlan delete profile name="ProfileName"
显示电脑上的全部无线配置文件
在命令提示符下,键入:
netsh wlan show profiles
显示安全密钥
在命令提示符下,键入:
netsh wlan show profile name="ProfileName" key=clear
中止自动链接到范围外的网络
在命令提示符下,键入:
netsh wlan set profileparameter name="ProfileName" connectionmode=manual(自动填auto)3d
一、wifi列表tooltip显示详细信息code
二、按照信号强度排序blog
三、链接状态显示排序
具体代码使用在项目里注释都很是清楚了ip
连接:http://pan.baidu.com/s/1eQlhH9S 密码:2alj
参考:
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