how can i learn my client ip with .NET?
.net, c#, network-programming, visual-studio
Solution
This can be achieved way easier using the automation interface from www.whatismyip.com, so there's no need for any regex:
static void Main(string[] args)
{
const string url = "http://www.whatismyip.com/automation/n09230945.asp";
var client = new WebClient();
try
{
var myIp = client.DownloadString(url);
Console.WriteLine("Your IP: " + myIp);
}
catch (Exception ex)
{
Console.WriteLine("Error contacting website: " + ex.Message);
}
}
Problem
i need my client ip from whatismyip.com. But Regex pattern is not correct i think? Can you help me this patttern?