"DotNetFan" <Do*******@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
I want to get the status of a remote host using C language, that is
whether
there is a hardware network connection between my computer and a remote
host
or not. Can somebody tell me how i can do it using VS.NET 2003?
Ping it?
If you don't have an IP address check the docs for gethostbyname() or
getaddrinfo(). Then send a ping message to it.
There is sample code to compose and send a ping message in the book "Network
Programming for Microsoft Windows" (MS Press, ISBN:0-7356-1579-9) by Jones
and Ohlund. A quick google seems to imply that a ping example is available
here too (though I did not download the ZIP):
http://www.sockaddr.com/ExampleSourceCode.html
Regards,
Will