// 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; class MainClass { public static void Main(string[] args) { IPAddress ip_start = IPAddress.Parse("1.1.1.1"); IPAddress ip_slut = IPAddress.Parse("1.1.2.3"); IPAddress ip = ip_start; while(IPAddress.NetworkToHostOrder((int)ip.Address) <= IPAddress.NetworkToHostOrder((int)ip_slut.Address)) { Console.WriteLine(ip); ip.Address = IPAddress.HostToNetworkOrder(IPAddress.NetworkToHostOrder((int)ip.Address)+1); } } }