> Sounds like you can only put an exception handle on it.
Here's the fix - Ping the machine first:
Ping netMon = new Ping();
PingReply response = netMon.Send(ComputerName, 4);
if (response.Address != null)
networkAccess = true;
else
{
networkAccess = false;
sb.AppendLine("Not online");
}
These are in System.Net.NetworkInformation namespace.
Brett
chanmm - 18 Nov 2006 03:28 GMT
Yeap Brett, good idea, really miss this one.
chanmm
> Here's the fix - Ping the machine first:
>
[quoted text clipped - 13 lines]
>
> Brett
Willy Denoyette [MVP] - 18 Nov 2006 11:06 GMT
| Here's the fix - Ping the machine first:
|
[quoted text clipped - 13 lines]
|
| Brett
A ping won't help if the server name or share name is mispelled, or if the
"Server" service is not running or if something else is wrong higher up in
the network stack.
Ping only tells you that the remote server's network stack is reachable up
to and including the IP layer. Note also that firewalls and routers may
prevent passing ICMP packets, so ping won't help in such environments
either.
Willy.