Exemple #1
0
        public static bool IsLocalAddress(IPAddress address)
        {
            var addressW = new IPAddressWrapper(address);

            return(IPAddressRange.APrivateClass.IsInIpV4Range(addressW) ||
                   IPAddressRange.AReservClass.IsInIpV4Range(addressW) ||
                   IPAddressRange.BPrivateClass.IsInIpV4Range(addressW) ||
                   IPAddressRange.BReservClass.IsInIpV4Range(addressW) ||
                   IPAddressRange.CPrivateClass.IsInIpV4Range(addressW));
        }
Exemple #2
0
 public bool IsInIpV4Range(IPAddressWrapper mid)
 {
     return(Begin.IpV4AddressLong < mid.IpV4AddressLong && mid.IpV4AddressLong < End.IpV4AddressLong);
 }
Exemple #3
0
 public IPAddressRange(string begin, string end)
 {
     _begin = new IPAddressWrapper(IPAddress.Parse(begin));
     _end   = new IPAddressWrapper(IPAddress.Parse(end));
 }
Exemple #4
0
 public IPAddressRange(IPAddress begin, IPAddress end)
 {
     _begin = new IPAddressWrapper(begin);
     _end   = new IPAddressWrapper(end);
 }