External IP Address Help...

Nov 21 2005 11:38 PM
I created this small application that would determine my IP Address and Hostname.  However, the IP Address it returns is of my Local Machine.  How can i get my application to return my External IP Address.  Thanks!

<--Here's My Code-->

using System.Windows.Forms;

using System;

using System.Net;

class MYDns

{

public static void Main()

{

string hostName = Dns.GetHostName();

IPAddress.DefaultIPGateway;

foreach (IPAddress address in myself.AddressList)

{

MessageBox.Show("IP Address: " + address.ToString(), "Your IP Address");

MessageBox.Show("Local HostName: " + hostName, "Your HostName");

}

}

}
<--End Of Code-->