简体   繁体   中英

Retrieve Proxy IP address C#

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 ideal.

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();
}
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM