how to get the PC-Name from connected PC's

Hi @all,

I ping the whole network (192.168.2.1 - 192.168.2.254) and return all IP-Adresses who returns the Ping-Request.

The result is a list with the IP-Adress, but not with the PC-Name

How can I get the Name of the other PC's from my Network

thanks for your fast help
Nikolai



Answer this question

how to get the PC-Name from connected PC's

  • Larry Niemoeller

    Hi Nikolai,

    The System.Net.Dns class's GetHostByAddress method will help you there.



  • abouhamzeh

    OK, after the successful inplementation I learned that the System.Net.Dns.GetHostEntry method is better to use than the GetHostByAddress method.


  • nmohd

    how do u ping the whole network
    can i get the sample code for doing this

  • Khaled Hussein

    http://msdn.microsoft.com/coding4fun/inthebox/netutils/default.aspx
    That's is a very good code example

  • how to get the PC-Name from connected PC's