foreach (var ip in IPAddressRange.Parse("192.168.0.1/23"))
{
Console.WriteLine(ip);
}
One of the big benefits of this method is if you have a huge range with say, 16 million addresses: you can start using the results of the enumeration immediately, and at no time does there need to be all 16 million IPs allocated in-memory at once (unless you want that and do something like IPAddressRange.Parse("10.0.0.1/8").ToList() of course).
Adds support for enumerating over the range.
One of the big benefits of this method is if you have a huge range with say, 16 million addresses: you can start using the results of the enumeration immediately, and at no time does there need to be all 16 million IPs allocated in-memory at once (unless you want that and do something like
IPAddressRange.Parse("10.0.0.1/8").ToList()
of course).