使用C#连接到无线网络
|
我正在使用Managed WiFi API和示例代码:
string profileName = \"Cheesecake\"; // this is also the SSID
string mac = \"52544131303235572D454137443638\";
string key = \"hello\";
string profileXml = string.Format(\"<?xml version=\\\"1.0\\\"?><WLANProfile xmlns=\\\"http://www.microsoft.com/networking/WLAN/profile/v1\\\"><name>{0}</name><SSIDConfig><SSID><hex>{1}</hex><name>{0}</name></SSID></SSIDConfig><connectionType>ESS</connectionType><MSM><security><authEncryption><authentication>open</authentication><encryption>WEP</encryption><useOneX>false</useOneX></authEncryption><sharedKey><keyType>networkKey</keyType><protected>false</protected><keyMaterial>{2}</keyMaterial></sharedKey><keyIndex>0</keyIndex></security></MSM></WLANProfile>\", profileName, mac, key);
wlanIface.SetProfile( Wlan.WlanProfileFlags.AllUser, profileXml, true );
wlanIface.Connect( Wlan.WlanConnectionMode.Profile, Wlan.Dot11BssType.Any, profileName );
我更新了代码以使用我的SSID和密钥,但是我不知道如何获取MAC地址。
没有找到相关结果
已邀请:
2 个回复
辽躺
拈吉勉犬姆