public ActionResult LoginValidationCode()
        {
            string code = ValidationCodeHelper.CreateValidateCode(5);

            byte[] bytes = ValidationCodeHelper.CreateValidateGraphic(code, 52);
            CookieHelper.SaveCookie <string>(AuthMgr.LOGIN_VERIFYCODE_COOKIE, code.Trim());
            return(File(bytes, @"image/jpeg"));
        }
Ejemplo n.º 2
0
        public ActionResult LoginValidationCode()
        {
            string code = ValidationCodeHelper.CreateValidateCode(5);

            Session["ValidateCode"] = code;
            byte[] bytes = ValidationCodeHelper.CreateValidateGraphic(code, 34);
            CookieHelper.SaveCookie <string>("VerifyCode", code.Trim());
            return(File(bytes, @"image/jpeg"));
        }
Ejemplo n.º 3
0
        public ActionResult LoginValidationCode()
        {
            string code = ValidationCodeHelper.CreateValidateCode(5);

            byte[] bytes   = ValidationCodeHelper.CreateValidateGraphic(code, 34);
            var    options = new CookieOptions()
            {
                Domain   = AppSettings.EnvironmentVariable == "pre" ? "MessageCenter.Pre" : "MessageCenter",
                HttpOnly = true
            };

            //验证码应该做加密处理,不然形同虚设
            HttpContext.Response.Cookies.Append("LoginVerifyCode", HashEncrypt.DESEncrypt(code.Trim(), "hpmcgctr"));
            return(File(bytes, @"image/jpeg"));
        }