// URL 的格式 Islsz.vicp.net
public static string GetIPByDomain(string url)
{
if (url.Trim() == string.Empty)
return "";
try
{
System.Net.IPHostEntry host = System.Net.Dns.GetHostEntry(url);
return host.AddressList.GetValue(0).ToString();
}
catch (Exception e)
{
throw new AppException("Can't fetch the IP.");
}
}