Skip to content

Instantly share code, notes, and snippets.

@OrigamiTech
Created February 4, 2011 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OrigamiTech/811490 to your computer and use it in GitHub Desktop.
Save OrigamiTech/811490 to your computer and use it in GitHub Desktop.
Dumps every IPv4 IP address to a text file.
using System;
using System.IO;
namespace EveryIPv4{
class Program{
static void Main(string[] args){
using(StreamWriter sw=new StreamWriter("dump.txt"))
for(uint u=uint.MinValue;u<=uint.MaxValue;u++)
for (byte b=0;b<4;b++)
sw.Write(((u>>((3-b)*8))&0xFF).ToString()+(b==3?'\n':'.'));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment