示例#1
0
        public static IPAddressRange Parse(string str)
        {
            var split  = str.Split('.');
            var tokens = new IPAddressToken[4];

            if (split.Length != 4)
            {
                throw new FormatException(string.Format("{0} must contains 3 dots", str));
            }

            for (var i = 0; i < split.Length; i++)
            {
                tokens[i] = IPAddressToken.Parse(split[i]);
            }

            return(new IPAddressRange(tokens));
        }
 public static IPAddressRange Parse(string str)
 {
     string[] array = str.Split(new char[]
     {
         '.'
     });
     IPAddressToken[] array2 = new IPAddressToken[4];
     if (array.Length != 4)
     {
         throw new FormatException(string.Format("{0} must contains 3 dots", str));
     }
     for (int i = 0; i < array.Length; i++)
     {
         array2[i] = IPAddressToken.Parse(array[i]);
     }
     return(new IPAddressRange(array2));
 }