internal string GetValue(HttpRequest request)
 {
     string str = null;
     if (this.IsDynamic)
     {
         if (request != null)
         {
             str = request.CalcDynamicServerVariable(this.Var);
         }
         return str;
     }
     return this.Value;
 }
Exemple #2
0
        internal string GetValue(HttpRequest request)
        {
            string str = null;

            if (this.IsDynamic)
            {
                if (request != null)
                {
                    str = request.CalcDynamicServerVariable(this.Var);
                }
                return(str);
            }
            return(this.Value);
        }
        internal String GetValue(HttpRequest request)
        {
            String v = null;

            if (IsDynamic)
            {
                if (request != null)
                {
                    v = request.CalcDynamicServerVariable(Var);
                }
            }
            else
            {
                v = Value;
            }

            return(v);
        }
        internal String GetValue(HttpRequest request) {
            String v = null;

            if (IsDynamic) {
                if (request != null)
                    v = request.CalcDynamicServerVariable(Var);
            }
            else {
                v = Value;
            }

            return v;
        }
        private String GetSimpleServerVar(String name)
        {
            // get server var without population of the collection
            // only most popular are included

            if (name != null && name.Length > 1 && _request != null)
            {
                switch (name[0])
                {
                case 'A':
                case 'a':
                    if (StringUtil.EqualsIgnoreCase(name, "AUTH_TYPE"))
                    {
                        return(_request.CalcDynamicServerVariable(DynamicServerVariable.AUTH_TYPE));
                    }
                    else if (StringUtil.EqualsIgnoreCase(name, "AUTH_USER"))
                    {
                        return(_request.CalcDynamicServerVariable(DynamicServerVariable.AUTH_USER));
                    }
                    break;

                case 'H':
                case 'h':
                    if (StringUtil.EqualsIgnoreCase(name, "HTTP_USER_AGENT"))
                    {
                        return(_request.UserAgent);
                    }
                    break;

                case 'Q':
                case 'q':
                    if (StringUtil.EqualsIgnoreCase(name, "QUERY_STRING"))
                    {
                        return(_request.QueryStringText);
                    }
                    break;

                case 'P':
                case 'p':
                    if (StringUtil.EqualsIgnoreCase(name, "PATH_INFO"))
                    {
                        return(_request.Path);
                    }
                    else if (StringUtil.EqualsIgnoreCase(name, "PATH_TRANSLATED"))
                    {
                        return(_request.PhysicalPath);
                    }
                    break;

                case 'R':
                case 'r':
                    if (StringUtil.EqualsIgnoreCase(name, "REQUEST_METHOD"))
                    {
                        return(_request.HttpMethod);
                    }
                    else if (StringUtil.EqualsIgnoreCase(name, "REMOTE_USER"))
                    {
                        return(_request.CalcDynamicServerVariable(DynamicServerVariable.AUTH_USER));
                    }
                    else if (StringUtil.EqualsIgnoreCase(name, "REMOTE_HOST"))
                    {
                        return(_request.UserHostName);
                    }
                    else if (StringUtil.EqualsIgnoreCase(name, "REMOTE_ADDRESS"))
                    {
                        return(_request.UserHostAddress);
                    }
                    break;

                case 'S':
                case 's':
                    if (StringUtil.EqualsIgnoreCase(name, "SCRIPT_NAME"))
                    {
                        return(_request.FilePath);
                    }
                    break;
                }
            }

            // do the default processing (populate the collection)
            return(null);
        }