厚积薄发-获取客户端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();

posted @ 2010-08-30 23:39  1店小二  阅读(183)  评论(0编辑  收藏  举报