Host to IP

  • Thread starter Thread starter Øyvind
  • Start date Start date
Ø

Øyvind

I'm trying to make a windows form application to ping, and convert host to
IP and IP to host. But it is little difficult to find a code that works,
will it be a lot of programming, or can this be done with a short and easy
code?

Thanks.
Johansen
 
Hi,

What is difficult, the code for ping or the code to do the host->ip and
ip->host?

The following will help for the later
System.Net.Dns.GetHostAddresses
System.Net.Dns.GetHostEntry

As for the ping, take a look at the following class
System.Net.NetworkInformation.Ping

Hope this helps
 
Chris Taylor said:
Hi,

What is difficult, the code for ping or the code to do the host->ip and
ip->host?


Yes, I have a TextBox1 where I put in a hostname, I click a button and the
IP will show in TextBox2. Or, if I put a IP adress in TextBox1, and push
another button, I get the hostname in TextBox2. That is the plan anyway :-)



Johansen
 
Back
Top