⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0046.htm

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

  </table>
<p align="center"><script src="../../2.js"></script></a>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -