如何在C ++中获取网络接口名称 [英] How do I get network interface name in C++
本文介绍了如何在C ++中获取网络接口名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要获得网络接口名称,如以太网,无线网络连接,Hamachi等。像windows命令 netsh界面show interface 那样。
我尝试过的事情:
我试过Windows功能如下:
I need to get network interface name like "Ethernet", "Wireless network connection", "Hamachi" etc. Something like windows command netsh interface show interface does.
What I have tried:
I tried Windows functions like:
GetAdaptersInfo()
GetInterfaceInfo()
来自iphlpapi.h的
,但没有返回我实际需要的名字。
from iphlpapi.h, but none returned the names I actually need.
推荐答案
可能是 GetAdaptersAddresses功能 [ ^ ]?
这篇关于如何在C ++中获取网络接口名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文