您的位置:首页 > 编程语言 > C#

C#编@程@使@用@Ma@n@a@g@ed@ W@i@f@i A@PI连@接@无@线@S@S@I@D

2016-09-22 21:50 246 查看
如何用C#去操作无线网卡连接无线网络一直是个人学习过程中的一大困惑。好在最近成功解决了这个问题。最近在写一个中国电信ChinaNet无线热点自动连接工具,期间用到了Managed Wifi API,使用起来很是方便。

操作步骤很简单:

1.下载Managed Wifi API

关于Managed Wifi API:This project is a .NET class library allowing you to control Wifi (802.11) network adapters installed in your Windows machine programmatically.

The library uses the Native Wifi API, available since Windows Vista and Windows XP SP2 (in a limited fashion, and only after applying a hotfix provided in KB article 918997). Older versions of Windows are not supported.

2.创建C#工程文件,并添加对ManagedWifi.dll的引用。



3.编写代码,引用“Native Wifi API”。

关键代码如下:

?
4.示例程序允许枚举当前网卡接收到的所有无线SSID,并支持接入开放认证(无密码)的无线热点。





5.其它

Wifi XML配置文件请参考微软文档
http://www.microsoft.com/networking/WLAN/profile/v1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: