Exemple #1
0
        /// <summary> Add a new IP address or contiguous IP addresses to this IP restrictive range </summary>
        /// <param name="StartIP"> IP address, or beginning of the contiguous IP addresses </param>
        /// <param name="EndIP"> End IP address, if this is a contiguous group of IP addresses </param>
        public void Add_IP_Address(string StartIP, string EndIP)
        {
            IP_Restriction_Address thisAddress = new IP_Restriction_Address(StartIP, EndIP);
            byte start = thisAddress.Start_Byte;
            byte end   = thisAddress.End_Byte;

            for (byte x = start; x <= end; x++)
            {
                if (ipAddresses.ContainsKey(x))
                {
                    ipAddresses[x].Add(thisAddress);
                }
                else
                {
                    List <IP_Restriction_Address> newList = new List <IP_Restriction_Address> {
                        thisAddress
                    };
                    ipAddresses.Add(x, newList);
                }
            }
        }
 /// <summary> Add a new IP address or contiguous IP addresses to this IP restrictive range </summary>
 /// <param name="StartIP"> IP address, or beginning of the contiguous IP addresses </param>
 /// <param name="EndIP"> End IP address, if this is a contiguous group of IP addresses </param>
 public void Add_IP_Address(string StartIP, string EndIP)
 {
     IP_Restriction_Address thisAddress = new IP_Restriction_Address(StartIP, EndIP);
     byte start = thisAddress.Start_Byte;
     byte end = thisAddress.End_Byte;
     for (byte x = start; x <= end; x++)
     {
         if (ipAddresses.ContainsKey(x))
             ipAddresses[x].Add(thisAddress);
         else
         {
             List<IP_Restriction_Address> newList = new List<IP_Restriction_Address> {thisAddress};
             ipAddresses.Add(x, newList);
         }
     }
 }