简体   繁体   中英

Getting list of local IP addresses with winapi

How to get a list of all local IP addresses connected to the LAN using WINAPI? I searched through netapi32.dll and haven't been successful. Any thoughts ?

There is no guaranteed way to get the addresses of all devices connected to your local segment. Machines may be firewalled and dropping requets, or have IP addresses in different subnets that the checking machine isn;t configured to access.

You can find all devices on the subnet that respond to a ping by sending a ping request (using ICMPSendEcho() in the IP Helper library) to every IP address on the local subnet and check for responses.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM