【问题标题】:How to detect Network type on Win Mobile如何在 Win Mobile 上检测网络类型
【发布时间】:2012-02-05 18:03:57
【问题描述】:

我花了很多时间寻找如何确定当前的网络类型,如 WIFI、3G、以太网。 但是我在windows平台网上找不到任何资料。

我想检测以太网网络类型,但我找不到任何可以检索网络类型的 API。 我已找到关键字的连接管理器,但信息较少。

有人知道吗? 请帮帮我...我被这个阻止了 2 周。

谢谢。

【问题讨论】:

    标签: windows winapi windows-ce windows-mobile


    【解决方案1】:

    查看注册表项HKLM\system\state\connections,每种可能的网络类型都有相应的条目,例如:

    连接到无线网络时:

    [HKLM\system\state\Connections\Network]
    Adapters="BCMSDDHD1"
    Count=dword:00000001
    Descriptions="Business World"
    

    当连接到 activesync 时:

    [HKLM\system\state\Connections\Desktop]
    Adapters=""
    Count=dword:00000001
    Descriptions="CurrentDTPTNetwork"
    

    HKLM\system\state\connections 下的 Count 值给出了活动连接的总数。

    HKLM\system\state\Hardware,您可以找到各种设备的当前电源状态。

    【讨论】:

      【解决方案2】:

      Windows Mobile 上有一个 API,可以更轻松地访问这些值,而不是直接访问注册表。请参阅 SystemState class documentation,特别是 ConnectionsNetworkCount 和 ConnectionsCount 属性。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-05-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-07-14
        • 2019-04-28
        相关资源
        最近更新 更多