Vlearns
asked on
VB doubt
Does someone know how this can be done?
i want to enter a host name through a input edit box
then i want to ping the host name using a command line so that i can retrieve the ip adress of that machine.
so that
vv.xx.yy.zz hostname in the 'hosts' file at
C:\WINDOWS\system32\driver
basically the problem is that is there some way so that
i can accept the host name from the user.
then find the ip address of that machine using say
ping hostname.com????????
is there any other way i can obtain the ip of the machine.
and add the entry to hosts file as above.
i have the code that writes to the hosts file .
i want some way to obtain the ip of the machine, given the host name in my application .
i know this seems tough. Can you help me with this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
no actually i know machines by their names.
so abc.def.com
i want the user to type in this name and be able to retrieve their ip address. i do not know how to do that using vb
pinging might be a primitive solution.
do you know a better way?
so abc.def.com
i want the user to type in this name and be able to retrieve their ip address. i do not know how to do that using vb
pinging might be a primitive solution.
do you know a better way?
If you are using VB.net then this is the best way:
System.Net.Dns.GetHostByNa me("www.microsoft.com").Add ressList(0 ).ToString ()
This will return the IP Address of www.microsoft.com
You just input a hostname and it returns the ipaddress.
System.Net.Dns.GetHostByNa
This will return the IP Address of www.microsoft.com
You just input a hostname and it returns the ipaddress.
If you are using VB6 then you have to use about a million lines of code but it can be done:
This website contains all the code:
http://vbnet.mvps.org/index.html?code/network/iplookup.htm
This website contains all the code:
http://vbnet.mvps.org/index.html?code/network/iplookup.htm
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i figured it out
thanks all
thanks all
Hi Vlearns,
What's your solution, who make the helps here? ;-)
What's your solution, who make the helps here? ;-)
A domain? If it is a domain you are trying
to track, you can simply connect to the
domain in place of IP, and then check
which IP you are connected to.