示例#1
0
        public override bool Equals(object obj)
        {
            if (obj == null || this.GetType() != obj.GetType())
            {
                return(false);
            }

            IPAddress_v4 c = (IPAddress_v4)obj;

            return(this.Value == c.Value);
        }
示例#2
0
        public bool?Validate(HttpRequest request)
        {
            IPAddress_v4 ip = IPAddress_v4.TryCreate(request.UserHostAddress);

            if (ip == null)
            {
                return(null);
            }

            if (this.IPAddresses.Contains(ip) == true)
            {
                return(false);
            }
            return(null);
        }
示例#3
0
        public Boolean?Validate(HttpRequest request)
        {
            var          req = request;
            IPAddress_v4 ip  = IPAddress_v4.TryCreate(req.UserHostAddress);

            if (ip == null)
            {
                return(null);
            }

            if (this.Start.Value <= ip.Value && ip.Value <= this.End.Value)
            {
                return(this.Allow);
            }
            return(!this.Allow);
        }
示例#4
0
 public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end, Boolean allow)
 {
     this.Start = start;
     this.End = end;
     this.Allow = allow;
 }
示例#5
0
 public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end)
 {
     this.Start = start;
     this.End = end;
     this.Allow = false;
 }
示例#6
0
 public IPAddressCondition(IPAddress_v4 address)
 {
     this.Start = address;
     this.End = address;
     this.Allow = false;
 }
示例#7
0
 public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end, Boolean allow)
 {
     this.Start = start;
     this.End   = end;
     this.Allow = allow;
 }
示例#8
0
 public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end)
 {
     this.Start = start;
     this.End   = end;
     this.Allow = false;
 }
示例#9
0
 public IPAddressCondition(IPAddress_v4 address)
 {
     this.Start = address;
     this.End   = address;
     this.Allow = false;
 }