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