如何在 Windows ce 中找到所有网络接口



在我的C#应用程序中,我需要识别在Windows ce 6.0上运行的设备的所有网络接口。

在点网完整框架中,我可以使用

NetworkInterface.GetAllNetworkInterfaces();

但我在紧凑的框架中没有看到相同的命名空间和类。
我需要类似于NetworkInterface.GetAllNetworkInterfaces()的代码。

一种选择是运行 windows 命令 "netsh" 并解析输出:

命令:

netsh interface show interface

输出:

Admin State    State          Type             Interface Name
-------------------------------------------------------------------------
Enabled        Connected      Dedicated        Ethernet 1
Enabled        Disconnected   Dedicated        Wi-Fi

最新更新