【问题标题】:How to find all the network interfaces in windows ce?如何在windows ce中找到所有的网络接口?
【发布时间】:2017-06-20 11:59:40
【问题描述】:

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

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

NetworkInterface.GetAllNetworkInterfaces();

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

【问题讨论】:

    标签: c# network-programming windows-ce


    【解决方案1】:

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

    命令:

    netsh interface show interface
    

    输出:

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

    【讨论】:

    • 当我尝试在 cmd.exe 上执行命令时,我得到“无法执行 netsh.exe”
    • @shivkumar 试试wmic nic get NetConnectionID。它显示常规连接接口,包括那些已禁用的接口。
    猜你喜欢
    • 2018-09-12
    • 1970-01-01
    • 2011-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多