I cant seem to get or find information on finding my routers public IP? Is this because it cant be done this way and would have to get it from a website?
With a few lines of code you can write your own Http Server for this.
HttpListener listener = new HttpListener();
listener.Prefixes.Add("http://+/PublicIP/");
listener.Start();
while (true)
{
HttpListenerContext context = listener.GetContext();
string clientIP = context.Request.RemoteEndPoint.Address.ToString();
using (Stream response = context.Response.OutputStream)
using (StreamWriter writer = new StreamWriter(response))
writer.Write(clientIP);
context.Response.Close();
}
Then anytime you need to know your public ip, you can do this.
WebClient client = new WebClient();
string ip = client.DownloadString("http://serverIp/PublicIP");