lengv10
//获取客户端、服务器、本地IP地址
        public static string getIPAddress()
        {
            ////本地IP
            //string address = System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName()).GetValue(2).ToString();//IP4 地址
            ////本地电脑名称
            //string addname = System.Net.Dns.GetHostName().ToString(); 

            //客户端IP
            HttpRequest Request = HttpContext.Current.Request;
            string clientIP = Request.UserHostAddress;

            return clientIP;
        }

  

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2021-12-31
  • 2022-01-17
  • 2021-12-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-06-20
相关资源
相似解决方案