📄 0046.htm
字号:
<html>
<head>
<title>新时代软件教程:操作系统 主页制作 服务器 设计软件 网络技术 编程语言 文字编辑</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
body, table {font-size: 9pt; font-family: 宋体}
a {text-decoration:none}
a:hover {color: red;text-decoration:underline}
.1 {background-color: rgb(245,245,245)}
-->
</style>
</head>
<p align="center"><script src="../../1.js"></script></a>
<p align="center"><big><strong>有关win2000、IIS5中asp详细出错信息的显示</strong></big></p>
<div align="right">---摘自《ChinaAsp网络》(文/bigeagle)</div><SPAN class=smallFont><SPAN class=smallFont>
最近经常有人问在win2000和IIS5中不显示asp错误的详细信息,而只显示错误号,如"错误ID800xxxxx",这使得程序调试很不方便,有些人采取在IIS中设置500-100错误指向默认,这样做也不会出现详细的错误信息。实际上这可能是微软出于安全考虑而在500-100.asp中没有显示详细出错信息。其实,你只要把500-100.asp稍加修改就可以了。下面是我修改的这个文件的内容。你只要把他copy下来存为500-100.asp然后覆盖原来的这个文件就可以了。注意文件中两行横线之间就是我修改的部分。<br>
<br>
<br>
500-100.asp:<br>
<br>
<br>
<%@ language="VBScript" %><br>
<%<br>
Option Explicit<br>
<br>
Const lngMaxFormBytes = 200<br>
<br>
Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP<br>
Dim strMethod, lngPos, datNow, strQueryString, strURL<br>
<br>
If Response.Buffer Then<br>
Response.Clear<br>
Response.Status = "500 Internal Server Error"<br>
Response.ContentType = "text/html"<br>
Response.Expires = 0<br>
End If<br>
<br>
Set objASPError = Server.GetLastError<br>
%><br>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><br>
<br>
<html dir=ltr><br>
<br>
<head><br>
<style><br>
a:link {font:9pt 宋体; color:FF0000}<br>
a:visited {font:9pt 宋体; color:#4e4e4e}<br>
</style><br>
<br>
<META NAME="ROBOTS" CONTENT="NOINDEX"><br>
<br>
<title>本页无法显示</title><br>
<br>
<META HTTP-EQUIV="Content-Type" Content="text-html; charset=gb2312"><br>
<META NAME="MS.LOCALE" CONTENT="ZH-CN"><br>
</head><br>
<br>
<script> <br>
function Homepage(){<br>
<!--<br>
// in real bits, urls get returned to our script like this:<br>
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm <br>
<br>
//For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"<br>
DocURL=document.URL;<br>
<br>
//this is where the http or https will be, as found by searching for :// but skipping the res://<br>
protocolIndex=DocURL.indexOf("://",4);<br>
<br>
//this finds the ending slash for the domain server <br>
serverIndex=DocURL.indexOf("/",protocolIndex + 3);<br>
<br>
//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining <br>
//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.<br>
//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);<br>
BeginURL=DocURL.indexOf("#",1) + 1;<br>
urlresult=DocURL.substring(BeginURL,serverIndex);<br>
<br>
//for display, we need to skip after http://, and go to the next slash<br>
displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);<br>
document.write('<A HREF="' + urlresult + '">' + displayresult + "</a>");<br>
}<br>
//--><br>
</script><br>
<br>
<body bgcolor="FFFFFF"><br>
<br>
<table width="410" cellpadding="3" cellspacing="5"><br>
<br>
<tr> <br>
<td align="left" valign="middle" width="360"><br>
<h1 style="COLOR:000000; FONT: 9pt 宋体"><!--Problem-->本页无法显示</h1><br>
</td><br>
</tr><br>
<br>
<tr><br>
<td width="400" colspan="2"><br>
<font style="COLOR:000000; FONT: 9pt 宋体">试图访问的网页出现问题,无法显示。</font></td><br>
</tr><br>
<br>
<tr><br>
<td width="400" colspan="2"><br>
<font style="COLOR:000000; FONT: 9pt 宋体"><br>
<br>
<hr color="#C0C0C0" noshade><br>
<br>
<p>请尝试以下方法:</p><br>
<br>
<ul><br>
<li id="instructionsText1">单击 <br>
<a href="javascript:location.reload()"><br>
刷新</a>按钮或者梢候再试。<br><br>
</li><br>
<br>
<li>打开 <br>
<br>
<script><br>
<!--<br>
if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))<br>
{<br>
Homepage();<br>
}<br>
//--><br>
</script><br>
<br>
主页,然后查找与所需信息相关的链接。 </li><br>
</ul><br>
<br>
<h2 style="FONT: 9pt 宋体; color:000000">HTTP 500.100 - 内部服务器错误 - ASP 错误<br><br>
Internet 信息服务</h2><br>
<br>
<hr color="#C0C0C0" noshade><br>
<br>
<p>技术信息(适用于支持人员)</p><br>
<br>
<ul><br>
<li>错误类型:<br><br>
<%<br>
Dim bakCodepage<br>
bakCodepage = Session.Codepage<br>
Session.Codepage = 936<br>
Response.Write Server.HTMLEncode(objASPError.Category)<br>
If objASPError.ASPCode > "" Then Response.Write Server.HTMLEncode(", " & objASPError.ASPCode)<br>
Response.Write Server.HTMLEncode(" (0x" & Hex(objASPError.Number) & ")" ) & "<br>"<br>
<br>
If objASPError.ASPDescription > "" Then Response.Write Server.HTMLEncode(objASPError.ASPDescription) & "<br>"<br>
<br>
blnErrorWritten = False<br>
<br>
' Only show the Source if it is available and the request is from the same machine as IIS<br>
If objASPError.Source > "" Then<br>
strServername = LCase(Request.ServerVariables("SERVER_NAME"))<br>
strServerIP = Request.ServerVariables("LOCAL_ADDR")<br>
strRemoteIP = Request.ServerVariables("REMOTE_ADDR")<br>
If (strServername = "localhost" Or strServerIP = strRemoteIP) And objASPError.File <> "?" Then<br>
Response.Write Server.HTMLEncode(objASPError.File)<br>
If objASPError.Line > 0 Then Response.Write ", 第 " & objASPError.Line & " 行"<br>
If objASPError.Column > 0 Then Response.Write ", 第 " & objASPError.Column & " 列"<br>
Response.Write "<br>"<br>
Response.Write "<font style=""COLOR:000000; FONT: 9pt 宋体""><b>"<br>
Response.Write Server.HTMLEncode(objASPError.Source) & "<br>"<br>
If objASPError.Column > 0 Then Response.Write String((objASPError.Column - 1), "-") & "^<br>"<br>
Response.Write "</b></font>"<br>
blnErrorWritten = True<br>
End If<br>
End If<br>
<br>
If Not blnErrorWritten And objASPError.File <> "?" Then<br>
Response.Write "<b>"<br>
Response.Write Server.HTMLEncode(objASPError.File)<br>
If objASPError.Line > 0 Then Response.Write Server.HTMLEncode(", 第 " & objASPError.Line & " 行")<br>
If objASPError.Column > 0 Then Response.Write ", 第 " & objASPError.Column & " 列"<br>
'-------------------------------------------------------------------<br>
' added by Bigeagle<br>
' date: 2000/5/10<br>
<br>
dim l_strAspDescription<br>
l_strAspDescription = "错误原因:" + objASPError.Description()<br>
if l_strAspDescription <> "" then<br>
response.write("<p>" + l_strAspDescription+ "</p>")<br>
end if<br>
<br>
l_strAspDescription = "详细描述:" + objASPError.ASPDescription()<br>
if l_strAspDescription <> "" then<br>
response.write("<p>" + l_strAspDescription+ "</p>")<br>
end if<br>
<br>
'------------------------------------------------------------------- <br>
Response.Write "</b><br>"<br>
End If<br>
%><br>
</li><br>
<p><br>
<li>浏览器类型:<br><br>
<%= Request.ServerVariables("HTTP_USER_AGENT") %><br>
</li><br>
<p><br>
<li>页:<br><br>
<%<br>
strMethod = Request.ServerVariables("REQUEST_METHOD")<br>
<br>
Response.Write strMethod & " "<br>
<br>
If strMethod = "POST" Then<br>
Response.Write Request.TotalBytes & " bytes to "<br>
End If<br>
<br>
Response.Write Request.ServerVariables("SCRIPT_NAME")<br>
<br>
lngPos = InStr(Request.QueryString, "|")<br>
<br>
If lngPos > 1 Then<br>
Response.Write "?" & Left(Request.QueryString, (lngPos - 1))<br>
End If<br>
<br>
Response.Write "</li>"<br>
<br>
If strMethod = "POST" Then<br>
Response.Write "<p><li>POST 数据:<br>"<br>
If Request.TotalBytes > lngMaxFormBytes Then<br>
Response.Write Server.HTMLEncode(Left(Request.Form, lngMaxFormBytes)) & " . . ."<br>
Else<br>
Response.Write Server.HTMLEncode(Request.Form)<br>
End If<br>
Response.Write "</li>"<br>
End If<br>
<br>
%><br>
<p><br>
<li>时间:<br><br>
<%<br>
datNow = Now()<br>
<br>
Response.Write Server.HTMLEncode(FormatDateTime(datNow, 1) & ", " & FormatDateTime(datNow, 3))<br>
Session.Codepage = bakCodepage<br>
%><br>
</li><br>
</p><br>
<p><br>
<li>详细信息:<br><br>
<% strQueryString = "prd=iis&sbp=&pver=5.0&ID=500;100&cat=" & Server.URLEncode(objASPError.Category) & _<br>
"&os=&over=&hrd=&Opt1=" & Server.URLEncode(objASPError.ASPCode) & "&Opt2=" & Server.URLEncode(objASPError.Number) & _<br>
"&Opt3=" & Server.URLEncode(objASPError.Description) <br>
strURL = "http://www.microsoft.com/ContentRedirect.asp?" & _<br>
strQueryString<br>
%><br>
<a href="<%= strURL %>">Microsoft 支持</a><br>
</li><br>
</p><br>
<br>
</font></td><br>
</tr><br>
<br>
</table><br>
</body><br>
</html><br>
</table>
<p align="center"><script src="../../2.js"></script></a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -