How to check network interface type is Ethernet or Wireless on Windows using Qt?

旧城冷巷雨未停 提交于 2019-12-22 08:26:38

问题


I need to find out the network interface type is Wired or Wireless on PC.

I have tried using QNetworkInterface class which provides Adapter Name. But adapter name can be changed by user on Windows. On Mac, I can check for interface type as eth0 or eth1 since it is same for all users.

I also tried QNetworkConfiguration::bearerType, But I am getting configuration as Ethernet i.e. BearerEthernet for both wired and wireless configuration.

Is there any other way to find out network interface type in Qt or using Windows platform specific APIs?


回答1:


This Native Wifi API example can help: http://msdn.microsoft.com/en-us/library/ms706749%28v=VS.85%29.aspx



来源:https://stackoverflow.com/questions/21680108/how-to-check-network-interface-type-is-ethernet-or-wireless-on-windows-using-qt

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