I have a WPF application. I need to know the external IP of the machine that is running this application.
I found some tutorials that teach to do this through the method DownloadString()
of class WebClient
consuming some services like dyndns.org
, icanhazip.com
, finally several services.
It would look something like this:
string meuIp = new WebClient().DownloadString("http://icanhazip.com");
To use such services I need to implement the query in at least a couple of three to ensure a contingency in case some service stops working or is discontinued.
Does anyone know if it is possible to do this natively with .Net Framework without using third-party services?