getCommandType.ashx 965 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <%@ WebHandler Language="C#" Class="getCommandType" %>
  2. using System;
  3. using System.Web;
  4. using System.Web.SessionState;
  5. using System.Data;
  6. using System.Text;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using Newtonsoft.Json;
  10. using Newtonsoft.Json.Linq;
  11. using Curtain.DataAccess;
  12. using DK.XuWei.WebMes;
  13. public class getCommandType : IHttpHandler, IReadOnlySessionState
  14. {
  15. public void ProcessRequest(HttpContext context)
  16. {
  17. context.Response.ContentType = "text/plain";
  18. using(IDataAccess conn = DataAccess.Create())
  19. {
  20. JArray json= new JArray(
  21. new JObject(new JProperty("id","1"),new JProperty("text","Text")),
  22. new JObject(new JProperty("id","4"),new JProperty("text","StoredProcedure"))
  23. );
  24. context.Response.Write(json.ToString());
  25. }
  26. }
  27. public bool IsReusable
  28. {
  29. get
  30. {
  31. return false;
  32. }
  33. }
  34. }