boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

Get Public/External IP Address in C#

Updated on     Kisan Patel

Here we will show you a simple and easy way to get public or external IP address in C#.

Here we will use freegeoip.net public HTTP API that provides a public HTTP API for software developers to search the geolocation of IP addresses.

public static string getExternalIp()
{
    try
    {
        string externalIP;
        externalIP = (new WebClient()).DownloadString("http://freegeoip.net/json/");
        externalIP = (new Regex(@"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"))
                        .Matches(externalIP)[0].ToString();
        return externalIP;
    }
    catch { return null; }
}

Example

class Program
{
    static void Main(string[] args)
    {
        string stringIPAddress = getExternalIp();
        Console.WriteLine("Your Public IP Address is: " + stringIPAddress);
        Console.ReadKey();
    }
}

Output of the above program…

external-ip-address


C#

Leave a Reply