【发布时间】:2011-06-08 16:28:07
【问题描述】:
我想获取计算机当前连接的无线网络的名称 (SSID)。我已经查看了 IP Helper API,但它似乎拥有除此之外的所有内容(DNS 服务器、IP 地址......)。任何帮助,将不胜感激。
【问题讨论】:
-
需要更多信息。什么操作系统?
我想获取计算机当前连接的无线网络的名称 (SSID)。我已经查看了 IP Helper API,但它似乎拥有除此之外的所有内容(DNS 服务器、IP 地址......)。任何帮助,将不胜感激。
【问题讨论】:
它取决于操作系统,最简单的方法可能是直接执行系统的 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
【讨论】:
您需要使用Native wifi API。您可以找到示例here(包括您询问的查询 SSID)。
【讨论】: