RoadFlow2.1 临时演示

VCode.ashx.cs 874B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.SessionState;
  6. namespace WebForm
  7. {
  8. /// <summary>
  9. /// VCode 的摘要说明
  10. /// </summary>
  11. public class VCode : IHttpHandler, IRequiresSessionState
  12. {
  13. public void ProcessRequest(HttpContext context)
  14. {
  15. string code;
  16. System.IO.MemoryStream ms = RoadFlow.Utility.Tools.GetValidateImg(out code, "~/Images/vcodebg.png");
  17. context.Session[RoadFlow.Utility.Keys.SessionKeys.ValidateCode.ToString()] = code;
  18. context.Response.ClearContent();
  19. context.Response.ContentType = "image/gif";
  20. context.Response.BinaryWrite(ms.ToArray());
  21. }
  22. public bool IsReusable
  23. {
  24. get
  25. {
  26. return false;
  27. }
  28. }
  29. }
  30. }