Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. using System.Web;
  2. public class AlarmHandler : IHttpHandler
  3. {
  4. // Constructor.
  5. public AlarmHandler() { }
  6.  
  7.  
  8. public void ProcessRequest(HttpContext context)
  9. {
  10. HttpRequest Request = context.Request;
  11. HttpResponse Response = context.Response;
  12.  
  13. // Test code.
  14. Response.Write("<html>");
  15. Response.Write("<body>");
  16. Response.Write("<h1>Hello from a synchronous custom HTTP handler.</h1>");
  17. Response.Write("</body>");
  18. Response.Write("</html>");
  19. }
  20.  
  21.  
  22. public bool IsReusable
  23. {
  24. get { return false; }
  25. }
  26. }
  27.  
  28. <% @ WebHandler language="C#" class="AlarmHandler" codebehind="AlarmHandler.ashx.cs" %>
  29.  
  30. <configuration>
  31. <system.webServer>
  32. <handlers>
  33. <add name="AlarmHandler" path="*.ashx" verb="*" type="IHttpHandler" />
  34. </handlers>
  35. </system.webServer>
  36. </configuration>
  37.  
  38. <% @ WebHandler language="C#" class="AlarmHandler" codebehind="AlarmHandler.ashx.cs" %>
  39.  
  40. <% @ WebHandler language="C#" class="Namespace.AlarmHandler" codebehind="AlarmHandler.ashx.cs" %>
  41.  
  42. <add name="AlarmHandler" path="*.ashx" verb="*" type="Namespace.AlarmHandler" />
  43.  
  44. <% @ WebHandler language="C#" class="AlarmHandler" %>
  45.  
  46. using System.Web;
  47.  
  48. public class AlarmHandler : IHttpHandler
  49. {
  50. // Constructor.
  51. public AlarmHandler() { }
  52.  
  53. public void ProcessRequest(HttpContext context)
  54. {
  55. HttpRequest Request = context.Request;
  56. HttpResponse Response = context.Response;
  57.  
  58. // Test code.
  59. Response.Write("<html>");
  60. Response.Write("<body>");
  61. Response.Write("<h1>Hello from a synchronous custom HTTP handler.</h1>");
  62. Response.Write("</body>");
  63. Response.Write("</html>");
  64. }
  65.  
  66. public bool IsReusable
  67. {
  68. get { return false; }
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement