Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

75 рядки
1.8KB

  1. <%@ Language="VBScript" %>
  2. <% Option Explicit %>
  3. <%
  4. Dim route, httpMethod, logDir, ctx, app, statusLine, contentType, body
  5. route = Request.QueryString("route")
  6. httpMethod = Request.ServerVariables("REQUEST_METHOD")
  7. logDir = Server.MapPath("logs")
  8. Set ctx = Nothing
  9. On Error Resume Next
  10. Set ctx = Server.CreateObject("WscMvc.RequestContext")
  11. If Err.Number <> 0 Then
  12. Err.Clear
  13. On Error Goto 0
  14. Response.Status = "500 Internal Server Error"
  15. Response.ContentType = "text/plain; charset=utf-8"
  16. Response.Write "Internal Server Error"
  17. Response.End
  18. End If
  19. On Error Goto 0
  20. On Error Resume Next
  21. ctx.Initialize route, httpMethod, logDir
  22. If Err.Number <> 0 Then
  23. Err.Clear
  24. On Error Goto 0
  25. Set ctx = Nothing
  26. Response.Status = "500 Internal Server Error"
  27. Response.ContentType = "text/plain; charset=utf-8"
  28. Response.Write "Internal Server Error"
  29. Response.End
  30. End If
  31. On Error Goto 0
  32. Set app = Nothing
  33. On Error Resume Next
  34. Set app = Server.CreateObject("WscMvc.Application")
  35. If Err.Number <> 0 Then
  36. Err.Clear
  37. On Error Goto 0
  38. Set ctx = Nothing
  39. Response.Status = "500 Internal Server Error"
  40. Response.ContentType = "text/plain; charset=utf-8"
  41. Response.Write "Internal Server Error"
  42. Response.End
  43. End If
  44. On Error Goto 0
  45. statusLine = ""
  46. contentType = ""
  47. body = ""
  48. On Error Resume Next
  49. app.Run ctx, statusLine, contentType, body
  50. If Err.Number <> 0 Then
  51. Err.Clear
  52. On Error Goto 0
  53. Set app = Nothing
  54. Set ctx = Nothing
  55. Response.Status = "500 Internal Server Error"
  56. Response.ContentType = "text/plain; charset=utf-8"
  57. Response.Write "Internal Server Error"
  58. Response.End
  59. End If
  60. On Error Goto 0
  61. Response.Status = statusLine
  62. Response.ContentType = contentType
  63. Response.Write body
  64. Set app = Nothing
  65. Set ctx = Nothing
  66. %>

Powered by TurnKey Linux.