public static bool?IsInternetIp(string ip, bool nullOnException = false) { try { return(IpAddressRange.IsInternetIp(ip)); } catch (Exception x) { if (nullOnException) { return(null); } else { throw x; } } }
public static bool IsInternetIp(IPAddress ip) { return(IpAddressRange.IsInternetIp(ip)); }