How to get local IP address of Windows system?

前端 未结 2 1576
攒了一身酷
攒了一身酷 2021-01-16 18:33

Is there any code or method to get the IP addresses of the local system?

2条回答
  •  离开以前
    2021-01-16 19:40

    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.

提交回复
热议问题