我正在寻找一个 WinAPI 函数来提取我的计算机连接到的当前 AP 的 WiFi 通道,例如下面输出中注明的通道 (11)。我可以通过“netsh”命令行来做到这一点,而且我显然可以编写一个程序来执行该命令并解析输出,但我希望找到一种更干净、更直接的方法。
C:\Users\>netsh wlan show interfaces
There is 1 interface on the system:
Name : Wireless Network Connection
Description : Intel(R) Centrino(R) Advanced-N 6200 AGN
GUID :
Physical address :
State : connected
SSID :
BSSID :
Network type : Infrastructure
Radio type : 802.11g
Authentication :
Cipher :
Connection mode :
***Channel*** : 11
Receive rate (Mbps) : 54
Transmit rate (Mbps) : 54
Signal : 99%
Profile :
Hosted network status : …Run Code Online (Sandbox Code Playgroud)