|
|
|
Expert:
|
nidhi
|
|
Date:
|
Jul 27, 2007
|
|
Time:
|
11:46
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
Thanks for the references, nidhi.
I decided to use the ping approach like this:
public bool CheckHostReachable(string host)
{
System.Net.NetworkInformation.Ping p = new Ping();
PingReply pingReply = p.Send(host, 5000);
return (pingReply.Status == IPStatus.Success);
}
I found out that there is also an asynchronous way of pinging, but since I needed the next action to be dependent on whether I had connectivity or not, I decided to use the synchronous way.
|
|
Expert:
|
dustPuppy
|
|
Date:
|
Jul 28, 2007
|
|
Time:
|
06:21
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
Yea, I think ping would be the best, at least then it doesnt care about how internet connection is made i.e. lan or modem. Depending on how speed is an issue when checking, you might want to think about hops. Not sure if you can specify how many hops you can make though.
|
|
Expert:
|
nidhi
|
|
Date:
|
Jul 28, 2007
|
|
Time:
|
10:21
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
|
|
|
|
This question has been answered, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for this question by clicking on the "Answer Summaries" Tab.
|
|