Ejemplo n.º 1
0
        /// <summary>
        ///     Splits the incoming ip string of the format "IP,IP" example "10.2.0.0,10.3.0.0" and adds the result to the IPList
        /// </summary>
        /// <param name="ips">The ips.</param>
        /// <param name="list">The list.</param>
        private void SplitAndAddSingleIPs(string ips, IpList list)
        {
            var splitSingleIPs = ips.Split(',');

            foreach (var ip in splitSingleIPs)
            {
                list.Add(ip);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Splits the incoming ip string of the format "IP;MASK,IP;MASK" example "10.2.0.0;255.255.0.0,10.3.0.0;255.255.0.0"
        ///     and adds the result to the IPList
        /// </summary>
        /// <param name="ips">The ips.</param>
        /// <param name="list">The list.</param>
        private void SplitAndAddMaskedIPs(string ips, IpList list)
        {
            var splitMaskedIPs = ips.Split(',');

            foreach (var maskedIp in splitMaskedIPs)
            {
                var ipAndMask = maskedIp.Split(';');
                list.Add(ipAndMask[0], ipAndMask[1]); // IP;MASK
            }
        }