【问题标题】:Obtaining currently connected network name (SSID) in C++在 C++ 中获取当前连接的网络名称 (SSID)
【发布时间】:2011-06-08 16:28:07
【问题描述】:

我想获取计算机当前连接的无线网络的名称 (SSID)。我已经查看了 IP Helper API,但它似乎拥有除此之外的所有内容(DNS 服务器、IP 地址......)。任何帮助,将不胜感激。

【问题讨论】:

  • 需要更多信息。什么操作系统?

标签: c++ ssid


【解决方案1】:

它取决于操作系统,最简单的方法可能是直接执行系统的 netsh 或等效命令,然后 grep 结果

例如。在 windows 'netsh wlan show int' 上给出

There is 1 interface on the system:

    Name                   : Wireless Network Connection
    Description            : Broadcom 802.11g Network Adapter
    GUID                   : 1de52c34-2e59-46c4-ae8d-8d442c44dfd
    Physical address       : 00:00:56:b6:ad:00
    State                  : connected
    SSID                   : xxx
    BSSID                  : 00:00:5b:27:83:ea
    Network type           : Infrastructure
    Radio type             : 802.11g
    Authentication         : Open
    Cipher                 : WEP
    Connection mode        : Auto Connect
    Channel                : 6
    Receive rate (Mbps)    : 54
    Transmit rate (Mbps)   : 54
    Signal                 : 90%
    Profile                : xxx

    Hosted network status  : Not started

【讨论】:

  • 谢谢,这可能是最简单的方法了。
【解决方案2】:

您需要使用Native wifi API。您可以找到示例here(包括您询问的查询 SSID)。

【讨论】:

    猜你喜欢
    • 2014-05-27
    • 2019-03-01
    • 2021-04-11
    • 1970-01-01
    • 2021-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-13
    相关资源
    最近更新 更多