Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 public FileContentResult GetVerifyCode()
 {
     return(File(VerifyCodeHelper.Create(), @"image/jpeg"));
 }