您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

78 行
2.0KB

  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. ' logs/ deliberately lives outside the served "public" webroot (IIS site
  8. ' physical path = public/), so a parent-relative MapPath is required here -
  9. ' requires enableParentPaths=true for this site. See docs/DECISIONS.md.
  10. logDir = Server.MapPath("../logs")
  11. Set ctx = Nothing
  12. On Error Resume Next
  13. Set ctx = Server.CreateObject("WscMvc.RequestContext")
  14. If Err.Number <> 0 Then
  15. Err.Clear
  16. On Error Goto 0
  17. Response.Status = "500 Internal Server Error"
  18. Response.ContentType = "text/plain; charset=utf-8"
  19. Response.Write "Internal Server Error"
  20. Response.End
  21. End If
  22. On Error Goto 0
  23. On Error Resume Next
  24. ctx.Initialize route, httpMethod, logDir
  25. If Err.Number <> 0 Then
  26. Err.Clear
  27. On Error Goto 0
  28. Set ctx = Nothing
  29. Response.Status = "500 Internal Server Error"
  30. Response.ContentType = "text/plain; charset=utf-8"
  31. Response.Write "Internal Server Error"
  32. Response.End
  33. End If
  34. On Error Goto 0
  35. Set app = Nothing
  36. On Error Resume Next
  37. Set app = Server.CreateObject("WscMvc.Application")
  38. If Err.Number <> 0 Then
  39. Err.Clear
  40. On Error Goto 0
  41. Set ctx = Nothing
  42. Response.Status = "500 Internal Server Error"
  43. Response.ContentType = "text/plain; charset=utf-8"
  44. Response.Write "Internal Server Error"
  45. Response.End
  46. End If
  47. On Error Goto 0
  48. statusLine = ""
  49. contentType = ""
  50. body = ""
  51. On Error Resume Next
  52. app.Run ctx, statusLine, contentType, body
  53. If Err.Number <> 0 Then
  54. Err.Clear
  55. On Error Goto 0
  56. Set app = Nothing
  57. Set ctx = Nothing
  58. Response.Status = "500 Internal Server Error"
  59. Response.ContentType = "text/plain; charset=utf-8"
  60. Response.Write "Internal Server Error"
  61. Response.End
  62. End If
  63. On Error Goto 0
  64. Response.Status = statusLine
  65. Response.ContentType = contentType
  66. Response.Write body
  67. Set app = Nothing
  68. Set ctx = Nothing
  69. %>

Powered by TurnKey Linux.