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?
Type "cmd" in the search box in the Start Menu or taskbar and click the Command Prompt icon to open the Windows command prompt. Type "ipconfig" in the command prompt window and take note of the IP address displayed.
Use an IP lookup tool Starting with the simplest way to find someone's IP address is to use one of the many IP lookup tools available online. Resources such as WhatIsMyIPAddress.com or WhatIsMyIP.com offer tools to enter an IP address and search for its free public registry results.
The terms public IP address and external IP address are essentially interchangeable. No matter which phrasing you prefer, the function is the same: a public (or external) IP address helps you connect to the internet from inside your network, to outside your network.
Using C#, With webclient its a short one.
public static void Main(string[] args) { string externalIpString = new WebClient().DownloadString("http://icanhazip.com").Replace("\\r\\n", "").Replace("\\n", "").Trim(); var externalIp = IPAddress.Parse(externalIpString); Console.WriteLine(externalIp.ToString()); }
Command Line (works on both Linux and Windows)
wget -qO- http://bot.whatismyipaddress.com
OR
curl http://ipinfo.io/ip
static void Main(string[] args) { HTTPGet req = new HTTPGet(); req.Request("http://checkip.dyndns.org"); string[] a = req.ResponseBody.Split(':'); string a2 = a[1].Substring(1); string[] a3=a2.Split('<'); string a4 = a3[0]; Console.WriteLine(a4); Console.ReadLine(); }
Do this small trick with Check IP DNS
Use HTTPGet
class i found on Goldb-Httpget C#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With