Get public IP using DynDNS and WebRequest C#
问题 I Use this code to get the public IP-address (thanks to this post How to get the IP address of the server on which my C# application is running on?): public static string GetPublicIP() { try { String direction = ""; WebRequest request = WebRequest.Create("http://checkip.dyndns.org/"); using (WebResponse response = request.GetResponse()) { using (StreamReader stream = new StreamReader(response.GetResponseStream())) { direction = stream.ReadToEnd(); } } //Search for the ip in the html int first