Hi
How can I retrieve my IP address from a C# Windows App??
Printable View
Hi
How can I retrieve my IP address from a C# Windows App??
This should help you out. :thumb:
I already looked at that ;) But its console, and I can't figure out how to convert the IP thing at the bottom to a windows app....
Hmmm I guess I don't understand this should give you your IP address:
Or am I way off on what you wan't here? lolVB Code:
private void Form1_Load(object sender, System.EventArgs e) { String strHostName = ""; IPHostEntry ipEntry = Dns.GetHostByName (strHostName); IPAddress [] addr = ipEntry.AddressList; for (int i = 0; i < addr.Length; i++) { strHostName += addr[i].ToString(); } textBox1.Text = "Your IP is: " + strHostName; }
Exactly what I needed ;) thx