public ActionResult GetValidateCode()
        {
            string code   = string.Empty;
            var    stream = ValidateCode.Create(out code);

            HttpContext.Session.SetString("ValidateCode", code);
            return(File(stream.ToArray(), @"image/jpeg"));
        }
Esempio n. 2
0
        public IActionResult ValidateCode()
        {
            ValidateCode _vierificationCodeServices = new ValidateCode();
            string       code = "";

            System.IO.MemoryStream ms = _vierificationCodeServices.Create(out code);
            CookieUtility.AppendCookie(TbConstant.WEBSITE_VERIFICATION_CODE, ServiceCollectionExtension.Encrypt(code));
            return(File(ms.ToArray(), @"image/png"));
        }
        public IActionResult ValidateCode()
        {
            ValidateCode _vierificationCodeServices = new ValidateCode();
            string       code = "";

            System.IO.MemoryStream ms = _vierificationCodeServices.Create(out code);
            CookieUtil.AppendCookie(Constants.WEBSITE_VERIFICATION_CODE, DataProtectionUtil.Protect(code));
            return(File(ms.ToArray(), @"image/png"));
        }