问题
can someone please tell me how I can extract Radio Type, Channel and Encryption information through Managed Wifi API in C#? I am able to see all the above information in my command prompt through "netsh wlan show interfaces" command (when I am connected to Wifi), however I am not looking to use this command and get the info in C#. Thanks.
回答1:
After doing lot of googling and R&D, I have found some solution of my problem. I have drilled down "WlanInterface" class under "WlanClient" class through which I was able to extract "Channel" and "Encryption" values. "Encryption" was little tricky, the code snippet is as follows:
Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);
Wlan.WlanAvailableNetwork network = networks.Where(x => x.flags.HasFlag(Wlan.WlanAvailableNetworkFlags.Connected)).FirstOrDefault();
muObject.Encryption = network.dot11DefaultCipherAlgorithm.ToString();
I have extracted "Radio Type" from netsh wlan query until I find the perfect solution... :-)
来源:https://stackoverflow.com/questions/42484721/get-radio-type-channel-and-encryption-from-managed-wifi-api-c-sharp