Get Radio Type, Channel and Encryption from Managed Wifi API c#

假装没事ソ 提交于 2019-12-13 06:59:47

问题


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

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