How to get IP of all hosts in LAN?
问题 I need to list IP addresses of all connected hosts in my LAN. What is the simplest way to do this? 回答1: You'll have to do a ping sweep. There's a Ping class in the System.Net namespace. Example follows. Also this is only possible if your computers don't have firewalls running. If they've got a firewall enabled, there's no way to determine this information short of doing SNMP queries on your switches. System.Net.NetworkInformation.Ping p = new System.Net.NetworkInformation.Ping(); System.Net