There are many ways of detecting external IP of router. One of the easiest if using "web services".
However, this method has risk of using because the web service may change anytime and therefore this method will no more applicable.
I will talk about how to request external IP from "external DNS" in other time. Today i talk about the easiest way first.
System.Net.HttpWebRequest request =
(System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create("http://www.what
ismyip.org/");
request.UserAgent = "User-Agent: Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
System.Net.HttpWebResponse response =
(System.Net.HttpWebResponse)request.GetResponse();
string myExternalIP = string.Empty;
using (System.IO.StreamReader reader = new
StreamReader(response.GetResponseStream()))
{
myExternalIP = reader.ReadToEnd();
reader.Close();
}
response.Close();
MessageBox.Show(myExternalIP);