厚积薄发获取客户端IP

//获取客户端IP
                if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null)
                    clientIP =

         System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
                else
         clientIP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();

原文地址:https://www.cnblogs.com/xiaoer/p/1813093.html