public static IsHostReachable ( string host ) : bool | ||
host | string | |
return | bool |
public static bool IsHostReachable (string host)
{
if (string.IsNullOrEmpty (host))
return false;
using (var r = new NetworkReachability (host)) {
NetworkReachabilityFlags flags;
if (r.TryGetFlags (out flags))
return IsReachableWithoutRequiringConnection (flags);
}
return false;
}