Example #1
0
 /// <summary>
 /// Checks if the specified IP Address is within the application's approved source IP range
 /// </summary>
 /// <param name="ip">The source IP address to check</param>
 /// <returns>true if the specified ip address is the the application's source IP range, false otherwise</returns>
 public bool HasValidSourceIP(IPAddress ip)
 {
     if (_sourceIpRange == null)
     {
         return(true);
     }
     else
     {
         return(_sourceIpRange.IsInRange(ip));
     }
 }
Example #2
0
        public static bool IsIpInRange(IPAddress ip, IPAddress lowerBandIp, IPAddress upperBandIp)
        {
            var range = new IpAddressRange(lowerBandIp, upperBandIp);

            return(range.IsInRange(ip));
        }
Example #3
0
        public static bool IsIpInRange(string ip, string lowerBandIp, string upperBandIp)
        {
            var range = new IpAddressRange(lowerBandIp, upperBandIp);

            return(range.IsInRange(ip));
        }