根据域名查IP (DNS解析)
public 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 e;
}
} 
posted on 2007-12-14 09:49 mjgforever 阅读(683) 评论(0) 收藏 举报


浙公网安备 33010602011771号