OpenNetCf SDF 未返回所有适配器

发布于 2025-01-02 22:24:38 字数 1039 浏览 0 评论 0原文

通过以下方式调用 GetAllNetworkInterfaces() 时:

INetworkInterface[] rgni = WirelessZeroConfigNetworkInterface.GetAllNetworkInterfaces();

我只取回一个适配器 RNDISFN1,它具有链接本地地址 (169.254....)。
我怀疑发生了一些不好的事情导致所有适配器都没有填充到阵列中;在调试器下,当我关闭该功能时,我看到:

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in CSharpSample.exe
A first chance exception of type 'System.MissingMethodException' occurred in OpenNETCF.Net.dll
A first chance exception of type 'OpenNETCF.Net.NetworkInformation.NetworkInformationException' occurred in OpenNETCF.Net.dll

明确地说,其最终目标是获取无线配置文件列表,并能够在它们之间进行切换。

目前,是否有人见过 GetAllNetworkInterfaces() 不返回所有适配器的实例?我在 Windows Mobile 6 下使用版本 OpenNetCF SDF v2.3。

When calling GetAllNetworkInterfaces() via:

INetworkInterface[] rgni = WirelessZeroConfigNetworkInterface.GetAllNetworkInterfaces();

I'm only getting back a single adapter back, RNDISFN1, which has a link-local address (169.254....).

I suspect something bad is happening to cause all of the adapters to not be populated in the array; under the debugger, when I fire off the function, I'm seeing:

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in CSharpSample.exe
A first chance exception of type 'System.MissingMethodException' occurred in OpenNETCF.Net.dll
A first chance exception of type 'OpenNETCF.Net.NetworkInformation.NetworkInformationException' occurred in OpenNETCF.Net.dll

To be clear, the end goal of this is to get a list of Wireless Profiles, and have the ability to switch between them.


For now, has anybody seen instances where GetAllNetworkInterfaces() doesn't return all of the adapters? I am using version OpenNetCF SDF v2.3 under Windows Mobile 6.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

强辩 2025-01-09 22:24:38

事实上,您看到一个适配器(我可以通过名称看出),这表明您已经处于摇篮状态。 ActiveSync 在其所有的荣耀中,在摇篮时会关闭所有其他无线电,因此不会出现其他无线电。在未支架时运行代码,您可能会看到您的 WiFi(和任何其他)适配器出现。

The fact you see a single adapter (and I can tell by the name) indicates that you're cradled. ActiveSync, in all its glory, shuts down all other radios when cradled and therefore no other radios will show up. Run the code when not cradled and you'll likely see your WiFi (and any other) adapters appear.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文