public IActionResult Index() { try { string randomCode = GeneralCodeHelper.GetRandomString(5); string encryptCode = DESEncryptHelper.EncryptDES(randomCode); WebHelper.WriteCookie("VerifyCode", encryptCode, 30); var imageByte = VerifyCodeHelper.Create(randomCode); return(File(imageByte, @"image/png")); } catch (Exception ex) { throw new Exception(ex.Message); } }
public FileContentResult GetVerifyCode() { return(File(VerifyCodeHelper.Create(), @"image/jpeg")); }