IP to value
using System.Linq; using System.Web; using Microsoft.Win32; public static class Helper { public static long IpToValue(string ip) { var parts = ip.Split('.').Select(i => int.Parse(i)).ToList(); return (parts[0] * 16777216) + (parts[1] * 65536) + (parts[2] * 256) + parts[3]; } }