473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

-- ping by ip address, not host name -- (or how do I add an IP address to a IPHostEntry object)

I've found tons of sample code on pinging - but all start with the host
name, resolve the ip address and do the ping.

Does anyone have any sample code that does a ping from an ip address
alone?

OR

Does anyone know how to add an ip address to the the address list of an
IPHostEntry object? I've tried ihe.AddressList[0] =... but I can't
seem to figure out how to pass the ip address.

If I can do this, then I pass the ip address and use the code I've
found online.

Thanks!

Andrew

Nov 16 '05 #1
1 1953
GetHostByName not only works with domain names, but also takes an IP address
in dotted decimal, e.g., "1.2.3.4". It returns the proper IPHostEntry
object. For example, if you are getting your domain or IP address for a ping
from a text box you can just pass this to GetHostByName. If you have a built
in IP address to ping just set it up as a string literal. There are other
ways to do all this, but I think this is closer to what you want.

Thomas P. Skinner [MVP]

"techprot-google04" <te***************@yahoo.com> wrote in message
news:10**********************@f14g2000cwb.googlegr oups.com...
I've found tons of sample code on pinging - but all start with the host
name, resolve the ip address and do the ping.

Does anyone have any sample code that does a ping from an ip address
alone?

OR

Does anyone know how to add an ip address to the the address list of an
IPHostEntry object? I've tried ihe.AddressList[0] =... but I can't
seem to figure out how to pass the ip address.

If I can do this, then I pass the ip address and use the code I've
found online.

Thanks!

Andrew

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Jeff | last post by:
Is there a way to echo back a case sensitive $HTTP_HOST in PHP? For example if I type HostName.domain.com in my browser I want to return it exactly as it appears in the location part of the browser...
6
by: Brian Henry | last post by:
is there a way to get the host name of someone? like mine is 68-23-123-123-pitt-pa.adelphia.net? Request.UserHostName doesn't seem to return the host name like it states in the documentation,...
2
by: brett | last post by:
I can get the IP address of a visitor on my site by $_SERVER; how do I get the corresponding URL. If the user is on Comcast, the URL (host name) may look like: ...
1
by: Hooyoo | last post by:
Hello everyone, Please tell me some methods to get host name from ip address, thank you.
2
by: martin lanny | last post by:
Simple network scanner is a part of my dotnet solution. It pings ip addresses in a selected network range and gives me the response time for each computer it finds. Anyhow, I would need to...
1
by: vijayB | last post by:
Hi All, I have written an application in which I m accessing remote host name using; System.net.dns.GetHostByAddress(<IP Address>).HostName It is working fine with Windows Vista and Windows...
2
Xx r3negade
by: Xx r3negade | last post by:
I'm making a C++ wrapper for the standard C BSD sockets. In my object's "connect" function, I have a "host string" that can be either a host name or an ip address. Is there any C function, or any...
1
by: sidd4one | last post by:
hi, hi i just want known how to get ip address by giving host name of a particular system in the network...
1
by: ukbasak | last post by:
Hi, I tried to print user name who ever accesss application. I added the code request.getHostName() and request.getRemoteAddr(). The get.getRemoteAddr() is showing IP address but the code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.