Obtaining currently connected network name (SSID) in C++

拜拜、爱过 提交于 2019-12-06 05:27:01

It's OS dependant, the easiest way may be to just shell out and exec the system's netsh or equivalent and then grep the result

eg. on windows 'netsh wlan show int' gives

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

You need to use the Native wifi API. You can find samples here (including query SSID as you asked).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!