Ejemplo n.º 1
0
        private string GetServerVar(object e)
        {
            HttpServerVarsCollectionEntry entry = (HttpServerVarsCollectionEntry)e;

            if (entry == null)
            {
                return(null);
            }
            return(entry.GetValue(this._request));
        }
Ejemplo n.º 2
0
        private void SetServerVariableManagedOnly(string name, string value)
        {
            this.Populate();
            HttpServerVarsCollectionEntry entry = (HttpServerVarsCollectionEntry)base.BaseGet(name);

            if ((entry != null) && entry.IsDynamic)
            {
                throw new HttpException(System.Web.SR.GetString("Server_variable_cannot_be_modified"));
            }
            base.InvalidateCachedArrays();
            base.BaseSet(name, new HttpServerVarsCollectionEntry(name, value));
        }
        // updates managed copy of server variable with current value from native header block
        private void SetServerVariableManagedOnly(String name, String value)
        {
            Debug.Assert(name != null);
            Debug.Assert(value != null);

            // populate in order to identify dynamic variables
            Populate();

            // dynamic server variables cannot be modified
            HttpServerVarsCollectionEntry entry = (HttpServerVarsCollectionEntry)BaseGet(name);

            if (entry != null && entry.IsDynamic)
            {
                throw new HttpException(SR.GetString(SR.Server_variable_cannot_be_modified));
            }

            InvalidateCachedArrays();
            // this will update an existing entry, or create one if it's new
            BaseSet(name, new HttpServerVarsCollectionEntry(name, value));
        }
        private String GetServerVar(Object e)
        {
            HttpServerVarsCollectionEntry entry = (HttpServerVarsCollectionEntry)e;

            return((entry != null) ? entry.GetValue(_request) : null);
        }