Request.UserHostName  获取远程客户端的 DNS 名称
Request.UserHostAddress  获取远程客户端的 IP 主机地址

解决方案 »

  1.   

    see
    http://www.aspfaq.com/show.asp?id=2044".....
    IIS does not automatically do reverse DNS lookups - by default, Request.ServerVariables("REMOTE_HOST") is populated with the same value as Request.ServerVariables("REMOTE_ADDR") - which is simply an IP address
      

  2.   

    //得到主机IP
    string hostIp = Request.ServerVariables["REMOTE_ADDR"];
    //得到主机名hostName 
    System.Net.IPAddress address = System.Net.IPAddress.Parse(hostIp);
    System.Net.IPHostEntry ipInfor = System.Net.Dns.GetHostByAddress(address);
    string hostName = ipInfor.HostName;记得给分哦。