我在这篇文章中转载了一个验证码生成的方法:http://www.cnblogs.com/youring2/archive/2013/04/03/2997859.html

要在WebPage中使用(MVC也适用),看下面的代码:

@{
    ValidateCode vCode = new ValidateCode();
    string code = vCode.CreateValidateCode(5);
    Session["ValidateCode"] = code;
    byte[] bytes = vCode.CreateValidateGraphic(code);
    Response.WriteBinary(bytes, "image/jpeg");
}

相关文章:

  • 2022-12-23
  • 2021-04-21
  • 2021-09-29
  • 2022-01-09
  • 2022-12-23
  • 2022-02-09
  • 2021-08-23
猜你喜欢
  • 2021-12-04
  • 2022-01-13
  • 2021-11-08
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2021-05-02
相关资源
相似解决方案