Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
5.6 KiB

  1. <%@ language="VBScript" %>
  2. <%
  3. Option Explicit
  4. Const lngMaxFormBytes = 200
  5. Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP
  6. Dim strMethod, lngPos, datNow, strQueryString, strURL
  7. If Response.Buffer Then
  8. Response.Clear
  9. Response.Status = "500 Internal Server Error"
  10. Response.ContentType = "text/html"
  11. Response.Expires = 0
  12. End If
  13. Set objASPError = Server.GetLastError
  14. %>
  15. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  16. <HTML><HEAD><TITLE>The page cannot be displayed</TITLE>
  17. <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
  18. <STYLE type="text/css">
  19. BODY { font: 8pt/12pt verdana }
  20. H1 { font: 13pt/15pt verdana }
  21. H2 { font: 8pt/12pt verdana }
  22. A:link { color: red }
  23. A:visited { color: maroon }
  24. </STYLE>
  25. </HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>
  26. <h1>The page cannot be displayed</h1>
  27. There is a problem with the page you are trying to reach and it cannot be displayed.
  28. <hr>
  29. <p>Please try the following:</p>
  30. <ul>
  31. <li>Contact the Web site administrator to let them know that this error has occured for this URL address.</li>
  32. </ul>
  33. <h2>HTTP 500.100 - Internal server error: ASP error.<br>Internet Information Services</h2>
  34. <hr>
  35. <p>Technical Information (for support personnel)</p>
  36. <ul>
  37. <li>Error Type:<br>
  38. <%
  39. Dim bakCodepage
  40. on error resume next
  41. bakCodepage = Session.Codepage
  42. Session.Codepage = 1252
  43. on error goto 0
  44. Response.Write Server.HTMLEncode(objASPError.Category)
  45. If objASPError.ASPCode > "" Then Response.Write Server.HTMLEncode(", " & objASPError.ASPCode)
  46. Response.Write Server.HTMLEncode(" (0x" & Hex(objASPError.Number) & ")" ) & "<br>"
  47. If objASPError.ASPDescription > "" Then
  48. Response.Write Server.HTMLEncode(objASPError.ASPDescription) & "<br>"
  49. elseIf (objASPError.Description > "") Then
  50. Response.Write Server.HTMLEncode(objASPError.Description) & "<br>"
  51. end if
  52. blnErrorWritten = False
  53. ' Only show the Source if it is available and the request is from the same machine as IIS
  54. If objASPError.Source > "" Then
  55. strServername = LCase(Request.ServerVariables("SERVER_NAME"))
  56. strServerIP = Request.ServerVariables("LOCAL_ADDR")
  57. strRemoteIP = Request.ServerVariables("REMOTE_ADDR")
  58. If (strServerIP = strRemoteIP) And objASPError.File <> "?" Then
  59. Response.Write Server.HTMLEncode(objASPError.File)
  60. If objASPError.Line > 0 Then Response.Write ", line " & objASPError.Line
  61. If objASPError.Column > 0 Then Response.Write ", column " & objASPError.Column
  62. Response.Write "<br>"
  63. Response.Write "<font style=""COLOR:000000; FONT: 8pt/11pt courier new""><b>"
  64. Response.Write Server.HTMLEncode(objASPError.Source) & "<br>"
  65. If objASPError.Column > 0 Then Response.Write String((objASPError.Column - 1), "-") & "^<br>"
  66. Response.Write "</b></font>"
  67. blnErrorWritten = True
  68. End If
  69. End If
  70. If Not blnErrorWritten And objASPError.File <> "?" Then
  71. Response.Write "<b>" & Server.HTMLEncode( objASPError.File)
  72. If objASPError.Line > 0 Then Response.Write Server.HTMLEncode(", line " & objASPError.Line)
  73. If objASPError.Column > 0 Then Response.Write ", column " & objASPError.Column
  74. Response.Write "</b><br>"
  75. End If
  76. %>
  77. </li>
  78. <li>Browser Type:<br>
  79. <%= Server.HTMLEncode(Request.ServerVariables("HTTP_USER_AGENT")) %>
  80. <br><br></li>
  81. <li>Page:<br>
  82. <%
  83. strMethod = Request.ServerVariables("REQUEST_METHOD")
  84. Response.Write strMethod & " "
  85. If strMethod = "POST" Then
  86. Response.Write Request.TotalBytes & " bytes to "
  87. End If
  88. Response.Write Request.ServerVariables("SCRIPT_NAME")
  89. Response.Write "</li>"
  90. If strMethod = "POST" Then
  91. Response.Write "<p><li>POST Data:<br>"
  92. ' On Error in case Request.BinaryRead was executed in the page that triggered the error.
  93. On Error Resume Next
  94. If Request.TotalBytes > lngMaxFormBytes Then
  95. Response.Write Server.HTMLEncode(Left(Request.Form, lngMaxFormBytes)) & " . . ."
  96. Else
  97. Response.Write Server.HTMLEncode(Request.Form)
  98. End If
  99. On Error Goto 0
  100. Response.Write "</li>"
  101. End If
  102. %>
  103. <br><br></li>
  104. <li>Time:<br>
  105. <%
  106. datNow = Now()
  107. Response.Write Server.HTMLEncode(FormatDateTime(datNow, 1) & ", " & FormatDateTime(datNow, 3))
  108. on error resume next
  109. Session.Codepage = bakCodepage
  110. on error goto 0
  111. %>
  112. <br><br></li>
  113. <li>More information:<br>
  114. <%
  115. strQueryString = "prd=iis&sbp=&pver=5.0&ID=500;100&cat=" & Server.URLEncode(objASPError.Category) & "&os=&over=&hrd=&Opt1=" & Server.URLEncode(objASPError.ASPCode) & "&Opt2=" & Server.URLEncode(objASPError.Number) & "&Opt3=" & Server.URLEncode(objASPError.Description)
  116. strURL = "http://www.microsoft.com/ContentRedirect.asp?" & strQueryString
  117. %>
  118. <ul>
  119. <li>Click on <a href="<%= strURL %>">Microsoft Support</a> for a links to articles about this error.</li>
  120. <li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180" target="_blank">Microsoft Product Support Services</a> and perform a title search for the words <b>HTTP</b> and <b>500</b>.</li>
  121. <li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr), and search for topics titled <b>Web Site Administration</b>, and <b>About Custom Error Messages</b>.</li>
  122. <li>In the IIS Software Development Kit (SDK) or at the <a href="http://go.microsoft.com/fwlink/?LinkId=8181">MSDN Online Library</a>, search for topics titled <b>Debugging ASP Scripts</b>, <b>Debugging Components</b>, and <b>Debugging ISAPI Extensions and Filters</b>.</li>
  123. </ul>
  124. </li>
  125. </ul>
  126. </TD></TR></TABLE></BODY></HTML>