如何获取Windows系统的本地IP地址? [英] How to get local IP address of Windows system?
本文介绍了如何获取Windows系统的本地IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何代码或方法来获取本地系统的IP地址?
Is there any code or method to get the IP addresses of the local system?
推荐答案
要枚举本地IP地址,请使用Win32 API GetAdaptersAddresses()
(支持IPv4和IPv6)功能. C/C ++示例包含在其文档中.
To enumerate local IP addresses, use the Win32 API GetAdaptersInfo()
(supports IPv4 only) or GetAdaptersAddresses()
(supports IPv4 and IPv6) function. C/C++ examples are included in their documentation.
这篇关于如何获取Windows系统的本地IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文