double IP_address_to_double(string ip) { int i =3; double sum=0; foreach(string octette in ip.Split(".")) { sum += Math.Pow(256, i) * Convert.ToDouble(octette); i--; } return sum; }