// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Net; namespace E { public class Program { public static int S2I(string addr) { return BitConverter.ToInt32(IPAddress.Parse(addr).GetAddressBytes(), 0); } public static string I2S(int addr) { return (new IPAddress(BitConverter.GetBytes(addr))).ToString(); } public static void Main(string[] args) { int ia = S2I("199.234.112.222"); string sa = I2S(ia); Console.WriteLine(sa); } } }