Windows XP SP3 上的 wlanAPI
我的 WPF 应用程序使用 ManagedWifi 手动控制 wifi 适配器连接到指定的网络。但是,当我在 Windows XP 上运行该应用程序时,我不断收到 Win32Exception:不支持该请求(本机错误代码 50)。
我测试的系统使用的是Windows XP SP3,并且我非常确定Windows XP SP3支持NativeWifi:
http://msdn.microsoft.com/en-us/library/ms706556(v=vs.85).aspx
这个是我用于连接的配置文件:
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>Louis_flucard</name>
<SSIDConfig>
<SSID>
<hex>4C6F7569735F666C7563617264</hex>
<name>Louis_flucard</name>
</SSID>
</SSIDConfig>
<connectionType>IBSS</connectionType>
<connectionMode>manual</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>open</authentication>
<encryption>none</encryption>
<useOneX>false</useOneX>
</authEncryption>
</security>
</MSM>
</WLANProfile>
这是我用来连接到无线网络的代码部分:
//profileXml is basically the Xml file above
wlanIface.SetProfile(Wlan.WlanProfileFlags.AllUser, profileXml, true);
wlanIface.Connect(Wlan.WlanConnectionMode.Profile, Wlan.Dot11BssType.Any, profileName);
任何帮助将不胜感激。谢谢。
编辑:添加标签c++。这应该是相关的,因为 C/C++ 也可以与 Native Wifi 一起使用。
My WPF application is using ManagedWifi to manually control the wifi adapter to connect to a specified network. However, when I run the application on Windows XP, I keep getting Win32Exception: The request is not supported (Native Error code 50).
The system that I was testing used Windows XP SP3, and I'm pretty sure that Windows XP SP3 supports NativeWifi:
http://msdn.microsoft.com/en-us/library/ms706556(v=vs.85).aspx
This is the profile I'm using for the connection:
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>Louis_flucard</name>
<SSIDConfig>
<SSID>
<hex>4C6F7569735F666C7563617264</hex>
<name>Louis_flucard</name>
</SSID>
</SSIDConfig>
<connectionType>IBSS</connectionType>
<connectionMode>manual</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>open</authentication>
<encryption>none</encryption>
<useOneX>false</useOneX>
</authEncryption>
</security>
</MSM>
</WLANProfile>
And this is the code section that I used to connect to the wireless network:
//profileXml is basically the Xml file above
wlanIface.SetProfile(Wlan.WlanProfileFlags.AllUser, profileXml, true);
wlanIface.Connect(Wlan.WlanConnectionMode.Profile, Wlan.Dot11BssType.Any, profileName);
Any help would be appreciated. Thank you.
EDIT: add tag c++. This should be relevant since C/C++ can also work with Native Wifi.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IIRC XP 不支持 WlanConnect 调用。请参阅 http 上支持的 API 列表://msdn.microsoft.com/en-us/library/windows/desktop/bb204766(v=vs.85).aspx。
IIRC the WlanConnect call isn't supported on XP. See the list of supported APIs at http://msdn.microsoft.com/en-us/library/windows/desktop/bb204766(v=vs.85).aspx.