Exemple #1
0
        public void ClearQuery()
        {
            if (m_QueryString.Length == 0)
            {
                return;
            }

            m_Query       = null;
            m_QueryString = string.Empty;
        }
Exemple #2
0
        /// <summary>
        /// 添加参数到QueryString。格式:key=value,且必须已经经过UrlEncode编码。
        /// </summary>
        /// <param name="query"></param>
        public void AttachQuery(string query)
        {
            if (string.IsNullOrEmpty(query))
            {
                return;
            }

            HttpValueCollection newQuery = UrlUtil.ParseQueryString(query);

            for (int i = 0; i < newQuery.Count; i++)
            {
                Query.Set(newQuery.GetKey(i), newQuery[i]);
            }

            m_QueryString = "?" + Query.ToString();
        }