System.Net.IPAddress ip = System.Net.IPAddress.Parse(Request.UserHostAddress);
                System.Net.IPHostEntry ihe 
= System.Net.Dns.GetHostEntry(ip);
                Label1.
Text = ihe.HostName;//主机名

 Response.Write(Page.Request.UserHostAddress.ToString());//获取IP
            
//Response.Write(Page.Request.ServerVariables["Server_Name"].ToString());//获取HOST域名
            Response.Write(Page.Request.ServerVariables
["Http_Host"].ToString());//获取HOST域名

相关文章:

  • 2021-04-05
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-10-05
猜你喜欢
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案