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?
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