Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
There are some article in code project talk about this,
however when i try to download and study the source code,
the link is broken!
Is there any suggestion?

If possible , i would like to try on developing a system that can scan the network and list out all the active PC within the network~

Question: what shall i know/study in order to achieve the requirement? (scan and list out the network)
Posted

Here is an article by Sacha Barber that has a working link:

Retreiving a list of network computer names using C#[^]

Basically, if you want to roll your own, I would recommend you first find your network IP address and Subnet. This will tell you what possible IP addresses other devices on the network have. Then you can ping each one to determine if they respond. On those that ping, do a WMI call to ask what their name is. If they respond, record that information. You now have a rudimentary network scanner.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Jun-12 15:02pm    
Agree, a 5.
--SA
This does more than you want (it retrieves the MAC address as well) but it does retrieve the IP addresses on the LAN - to convert them to the name is pretty simple: Retrieving IP and MAC addresses for a LAN[^]

C#
System.Net.IPHostEntry he = System.Net.Dns.GetHostByAddress("192.168.0.10");
Console.WriteLine(he.HostName);
 
Share this answer
 
Comments
Shahin Khorshidnia 26-Jun-12 12:21pm    
+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