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;
}
}
调用方法: 
GetIPByDomain("www.it55.com");

转自:http://www.chenjiliang.com/Article/View.aspx?ArticleID=4150&TypeID=84

相关文章:

  • 2021-12-27
  • 2021-05-28
  • 2021-08-12
  • 2021-12-02
  • 2021-11-16
  • 2022-12-23
猜你喜欢
  • 2021-06-29
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
相关资源
相似解决方案