用CSharp实现url2ip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public class client
{
public string GeturlIP(string URL){
string IP = string.Empty;
try{
IPHostEntry ipinfo = Dns.GetHostEntry(URL);
foreach(IPAddress IPADDRESS in ipinfo.AddressList)
{
IP = IPADDRESS.ToString();
}
}
catch {}
return IP;
}
}
------ 文章已经结束,谢谢你的阅读 ------
------ article has ended,thank you for reading ------
Thanks support Me

---------------- The End ----------------