Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

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?
0
jayrod
Asked:
jayrod
  • 2
1 Solution
 
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
 
vinhnlCommented:
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
 
jayrodAuthor Commented:
that code doesn't work.. and I'm not following how it's itterating through the addresses?
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now