Reputation: 963
For example to get local ip address I use:
string myHost = System.Net.Dns.GetHostName();
string myIP = System.Net.Dns.GetHostEntry(myHost).AddressList[0].ToString();
Upvotes: 4
Views: 605
Reputation: 4886
here's a link that may help. http://www.dreamincode.net/forums/topic/24692-showing-the-external-ip-address-in-c%23/
There's a good post on doing a webrequest to WhatIsMyIP.com
Upvotes: 3