index.ashx 848 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <%@ WebHandler Language="C#" Class="index" %>
  2. using System;
  3. using System.Web;
  4. using Newtonsoft.Json.Linq;
  5. public class index : IHttpHandler
  6. {
  7. public void ProcessRequest(HttpContext context)
  8. {
  9. context.Response.ContentType = "text/plain";
  10. Random random = new Random();
  11. string jsonData = string.Format(@"
  12. [
  13. [{0},{1},{2},{3},{4}],
  14. [{5},{6},{7},{8},{9}]
  15. ]
  16. ",
  17. random.Next(1, 20),
  18. random.Next(1, 20),
  19. random.Next(1, 20),
  20. random.Next(1, 20),
  21. random.Next(1, 20),
  22. random.Next(1, 20),
  23. random.Next(1, 20),
  24. random.Next(1, 20),
  25. random.Next(1, 20),
  26. random.Next(1, 20)
  27. );
  28. context.Response.Write(jsonData);
  29. }
  30. public bool IsReusable
  31. {
  32. get
  33. {
  34. return false;
  35. }
  36. }
  37. }