public string GetHostNameByIp( string ip)
{
     ip = ip.Trim();
     if (ip == string .Empty)
         return string .Empty;
     try
     {
         // 是否 Ping 的通
         if ( this .Ping(ip))
         {
             System.Net.IPHostEntry host =
             System.Net.Dns.GetHostEntry(ip);
             return host.HostName;
         }
         else
             return string .Empty;
     }
     catch (Exception)
     {
         return string .Empty;
     }
}

转载优特建站:http://www.youtiy.com/Articles/Item.aspx?Id=256