Ejemplo n.º 1
0
        /// <summary>
        /// 获取一个Cookie的值
        /// </summary>
        /// <param name="name">name</param>
        /// <returns></returns>
        public static string GetValue(string name)
        {
            HttpCookie cookie = HttpContext.Current.Request.Cookies[name];

            string str = string.Empty;

            cookie.IfNullOrEmpty(() =>
            {
                str = WebUtil.UrlDeCode(cookie.Value);
            });

            return(str);
        }