Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi ,

I want to get all the ip addresses in the local network which is accessible from my pc or you can say i want all the ip addresses in local domain.

I want answers in C# language.
Posted

Noone is going to write your code for you.

You can either ping every IP address in your subnet range (could take a while!) or you can limit yourself to devices that have a machine account and query Active Directory for all of the computer accounts and get their addresses from the returned objects.
 
Share this answer
 
Comments
Kasson 27-Dec-10 1:14am    
Good Call Dave. My 5 too
Read the subnet mask and calculate all the IP addresses in the subnet mask you are in. Then you can either user ICMP ping (standard ping) or ARP ping to list all the valid IP addresses. ARP Ping is much reliable in a subnet setting.

You can nmap to list all the hosts
nmap -nsP 192.168.10.1/254 | grep ^Host
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 27-Dec-10 1:29am    
My 5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900