locked
Methode to get the extarnal IP in WP8, Windows store app and universal apps RRS feed

  • General discussion

  • Here is a simple method to get the the external IP address of the device:

            public async Task<string> GetExternalIp()
            {
                HttpClient http = new System.Net.Http.HttpClient();
                HttpResponseMessage response = await http.GetAsync("https://www.feron.it/ip.php");
                return await response.Content.ReadAsStringAsync();
            }
    This is by far the easiest way to do this.

    Visit my blog Coding Adventures to read the most annoying coding troubles and there solutions

    Sunday, July 27, 2014 7:55 PM