获取客户端IP

   string clientIP = HttpContext.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                    if (string.IsNullOrEmpty(clientIP))
                        clientIP = HttpContext.Request.ServerVariables["REMOTE_ADDR"];
                    if (string.IsNullOrEmpty(clientIP))
                        clientIP = HttpContext.Request.UserHostAddress;

posted on   静欲动  阅读(89)  评论(0编辑  收藏  举报

努力加载评论中...

导航

点击右上角即可分享
微信分享提示