I need to know what this proxy and in the past I used an IP webservice to get the IP. Is there was some way in C# to get the actually proxy IP address.
If I could just ping somewhere and get the IP that way that would be ide开发者_JAVA百科al.
found a possible solution here
protected void DNSLookup(string domain)
{
try
{
//performs the DNS lookup
IPHostEntry he = Dns.GetHostByName(domain);
IPAddress[] ip_addrs = he.AddressList;
txtIPs.Text = "";
foreach (IPAddress ip in ip_addrs)
{
txtIPs.Text += ip + "\n";
}
}
catch (System.Exception ex)
{
lblStatus.Text = ex.ToString();
}
}
精彩评论