networked computers

I'd like to display on a webpage a list of computers and what IP address they are at. so maybe display  a list of computers in the subrange of 10.1.1.*

so loop through 255 ip's ping or lookup or however it is you do it and see if that ip address is open or not.

Anyone have some suggestions on how to do this?
LVL 3
jayrodAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
vinhnlConnect With a Mentor Commented:
hi Jay,

try this code:

// store list of computers
ArrayList computers = new ArrayList();

// get computer list
for(int i = 1; i<256; i++)
{
    try
    {
        IPHostEntry hostentry = Dns.GetHostByAddress(new IPAddress(new byte[]{10,1,1,1}));
        computers.Add(hostentry.HostName);
    }
    catch{};//fail
}

Good Luck,
VINHNL
0
 
somnaticCommented:
here you can find a ping utility for C# code ..
http://www.c-sharpcorner.com/network/ping.asp

0
 
jayrodAuthor Commented:
I guess I need to know how to resolve the IP first?  cause I won't have the host name till later
0
 
jayrodAuthor Commented:
that code doesn't work.. and I'm not following how it's itterating through the addresses?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.