楼主:
string hostIp = Request.ServerVariables["REMOTE_ADDR"];
System.Net.IPAddress address = System.Net.IPAddress.Parse(hostIp);
System.Net.IPHostEntry ipInfor = System.Net.Dns.GetHostByAddress(address);
Session["hostName"]= ipInfor.HostName;
这段代码在自己的电脑可以得到主机名,可是上传到服务器出错,这是什么原因呢?