Skip to content

Instantly share code, notes, and snippets.

@gpake
Created July 7, 2012 03:46
Show Gist options
  • Save gpake/3064414 to your computer and use it in GitHub Desktop.
Save gpake/3064414 to your computer and use it in GitHub Desktop.
//get ip form local
string name = dns.getHostName();//the host's name
IPHostEntry me = dns.getHostEntry(name);
foreach(IPAddress ip in me.AddressList) {
listbox.items.add(ip)
}
IPAddress localip = IPaddress.pares(@"127.0.0.1");
IPEndPoint iep = new IPEndPoint(localip, 80);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment