【发布时间】:2012-02-28 02:42:37
【问题描述】:
通过以下方式调用 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 版本。
【问题讨论】:
-
这是什么类型的硬件?当未通过 ActiveSync 附加时,当您运行相同的代码时,结果如何变化?
-
克里斯——好点; ActiveSync 已禁用无线电。如果我强制打开收音机,我会在列表中看到适配器。可悲的是,OpenNetCF(我敢肯定,Win API)将此适配器视为以太网;我无法将其转换为 WirelessZeroConfigNetworkInterface 或 WirelessNetworkInterface。
-
@Chris:这是在 Socket Mobile 650 上运行的。关于我的次要评论(为什么我将其视为以太网),我还没有将最新的 Socket 服务包应用到这个单元。之后适配器可能会将自己宣传为 WZC。
-
@Chris:刚申请了最新的SP;不用找了;仍然报告为以太网。无论哪种方式,您对“您已被摇篮,wifi 已关闭”的回答最终回答了我最初的问题。如果您发布具有相同信息的答案,我会将其视为已接受。
标签: c# windows-mobile opennetcf