/// <summary>
        /// 设置 cookie
        /// </summary>
        /// <param name="domain"></param>
        /// <param name="name"></param>
        /// <param name="value">如果 value 为空,为删除 cookie</param>
        /// <param name="minute">如果 minute &lt;=0, 则为 no-presist cookie(session cookie)</param>
        /// <param name="httponly">是否为 httpOnly cookie</param>
        /// <param name="isCrypto">是否加密存储</param>
        public void SetCookie(string domain, string name, string value, int minute, bool httpOnly, bool isCrypto)
        {
            if (string.IsNullOrEmpty(name))
            {
                return;
            }

            if (string.IsNullOrEmpty(value))
            {
                var oldCookie = Response.Cookies[name];

                if (oldCookie == null)
                {
                    return;
                }
                oldCookie.Expires = DateTime.Now.AddDays(-10);
                oldCookie.Value   = null;
                oldCookie.Domain  = domain;
                return;
            }


            if (Request.Browser.Cookies == false)
            {
                return;
            }

            var cookie = Response.Cookies[name];

            if (cookie == null)
            {
                cookie = new HttpCookie(name);
            }

            if (minute > 0)
            {
                cookie.Expires = DateTime.Now.AddMinutes(minute);
            }

            cookie.Domain = domain;

            if (Response.Cookies[name] != null)
            {
                Response.Cookies.Remove(name);
                Request.Cookies.Remove(name);
            }

            if (isCrypto)
            {
                cookie.Value = SecurityCore.Encode(value);
            }
            else
            {
                cookie.Value = value;
            }
            cookie.HttpOnly = httpOnly;

            Response.Cookies.Add(cookie);
        }
        public string GetCookie(string name, bool isCrypto)
        {
            if (Request == null)
            {
                return(string.Empty);
            }

            HttpCookie cookie = Request.Cookies[name];

            if (cookie == null || cookie.Value == null)
            {
                return(string.Empty);
            }

            if (isCrypto)
            {
                return(SecurityCore.Decode(cookie.Value));
            }
            else
            {
                return(cookie.Value);
            }
        }
 /// <summary>
 /// 默认简单解密
 /// </summary>
 /// <param name="str"></param>
 /// <returns></returns>
 public static string DefaultDecode(string str)
 {
     return(SecurityCore.DecodeDec(str, "!))*^123", "%%&%()&!"));
 }