asp.net 局域网中获取 client的机器名

  //获取客户端计算机名称
            System.Net.IPAddress clientIP = System.Net.IPAddress.Parse(Request.UserHostAddress);//根据目标IP地址获取IP对象
            System.Net.IPHostEntry ihe = System.Net.Dns.GetHostEntry(clientIP);//根据IP对象创建主机对象
            string clientPCName = ihe.HostName;//获取客户端主机名称

 

posted @ 2017-08-31 12:21  小小高  阅读(507)  评论(0编辑  收藏  举报