Reqeust["keyname"] 的读取顺序

Reqeust["keyname"] 的读取顺序 ,寓意深远,回味无穷。 

 

public string this[string key]
{
    get
    {
        string str = this.QueryString[key];
        if (str != null)
        {
            return str;
        }
        str = this.Form[key];
        if (str != null)
        {
            return str;
        }
        HttpCookie cookie = this.Cookies[key];
        if (cookie != null)
        {
            return cookie.Value;
        }
        str = this.ServerVariables[key];
        if (str != null)
        {
            return str;
        }
        return null;
    }
}

posted @ 2012-08-24 14:52  哥,我还要  阅读(154)  评论(0编辑  收藏  举报