C#获取地址栏值

        /// <summary>
        /// 取地址栏值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public static string GetQueryString(string key, HttpContext context)
        {
            string k = string.Empty;
            if (context.Request.QueryString[key] != null)
            {
                k = context.Request.QueryString[key].ToString();
            }
            return k;
        }

评论