教程中国
PHOTOSHOP CS9.0中文版 MAYA 8.5 FOR WINDOWS Corel Painter v9.0 Flash MX2004 中文版 Illustrator cs2 中文版
VC++6.0含sp6 中英文版 VB6.0 +sp6 简体中文版 Borland Delphi 7汉化版 MSDN for vb6.0中文版 Visual Studio 2005简体
教程中国下属 文件存储共享专家BIBIDU.COM 提供大型软件,教材,源码,电影,音乐,图书等下载 更多精品请点此进入
  您目前所在位置: 教程中国 >> 编程基地 >> ASP >> 让你的错误提示更生动 RSS订阅
让你的错误提示更生动
让你的错误提示更生动(1)
教程(视频,书籍)下载:  ASP.NET AutoCAD 数据库 C# ASP java photoshop 网页设计 delphi 3dmax Flash C++ VB 张孝祥 实例   更多请进入BIBIDU搜索
IT搜索引擎   
 

默认的IIS 500-100.asp文件错误提示只报到行号,这对我们找错误还是很麻烦的

本文件是修改后的500-100.asp文件,直接显示出错行的文本,便于查找错误

<%@ language="VBScript" %>
<%
  Option Explicit

  Const lngMaxFormBytes = 200

  Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP
  Dim strMethod, lngPos, datNow, strQueryString, strURL

  If Response.Buffer Then
    Response.Clear
    Response.Status = "500 Internal Server Error"
    Response.ContentType = "text/html"
    Response.Expires = 0
  End If

  Set objASPError = Server.GetLastError
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<html dir=ltr>

<head>
<style>
a:link   {font:9pt 宋体; color:FF0000}
a:visited  {font:9pt 宋体; color:#4e4e4e}
</style>

<META NAME="ROBOTS" CONTENT="NOINDEX">

<title>本页无法显示</title>

<META HTTP-EQUIV="Content-Type" Content="text-html; charset=gb2312">
<META NAME="MS.LOCALE" CONTENT="ZH-CN">
</head>

<script>
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm

 //For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
 DocURL=document.URL;
 
 //this is where the http or https will be, as found by searching for :// but skipping the res://
 protocolIndex=DocURL.indexOf("://",4);
 
 //this finds the ending slash for the domain server
 serverIndex=DocURL.indexOf("/",protocolIndex + 3);

 //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
 //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
 //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
 BeginURL=DocURL.indexOf("#",1) + 1;
 urlresult=DocURL.substring(BeginURL,serverIndex);
  
 //for display, we need to skip after http://, and go to the next slash
 displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
 document.write( '<A HREF="' + escape(urlresult) + '">' + displayresult + "</a>");
}
//-->
</script>

<body bgcolor="FFFFFF">

<table width="100%" cellpadding="3" cellspacing="5">

  <tr>   
    <td align="left" valign="middle" width="360">
 <h1 style="COLOR:000000; FONT: 9pt 宋体"><!--Problem-->本页无法显示</h1>
    </td>
  </tr>
 
  <tr>
    <td width="100%" colspan="2">
 <font style="COLOR:000000; FONT: 9pt 宋体">试图访问的网页出现问题,无法显示。</font></td>
  </tr>
 
  <tr>
    <td width="100%" colspan="2">
 <font style="COLOR:000000; FONT: 9pt 宋体">

 <hr color="#C0C0C0" noshade>
 
    <p>请尝试以下方法:</p>

 <ul>
      <li id="instructionsText1">单击
      <a href="javascript:location.reload()">
      刷新</a>按钮或者梢候再试。<br>
      </li>
  
      <li>打开
  
   <script>
   <!--
   if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))
   {
     Homepage();
   }
   //-->
   </script>

   主页,然后查找与所需信息相关的链接。 </li>
    </ul>
 
    <h2 style="FONT: 9pt 宋体; color:000000">HTTP 500.100 - 内部服务器错误 - ASP 错误<br>
    Internet 信息服务</h2>

 <hr color="#C0C0C0" noshade>
 
 <p>技术信息(适用于支持人员)</p>

||||||<ul>
<li>错误类型:<br>
<%
  Dim bakCodepage
  bakCodepage = Session.Codepage
  Session.Codepage = 936
  Response.Write Server.HTMLEncode(objASPError.Category)
  If objASPError.ASPCode > "" Then Response.Write Server.HTMLEncode(", " & objASPError.ASPCode)
  Response.Write Server.HTMLEncode(" (0x" & Hex(objASPError.Number) & ")" ) & "<br>"

  If objASPError.ASPDescription > "" Then Response.Write Server.HTMLEncode(objASPError.ASPDescription) & "<br>"

  blnErrorWritten = False

  ' Only show the Source if it is available and the request is from the same machine as IIS

来源:upschool.cn
作者:
关键字:错误提示更生动
发表日期:2006-7-26

网页显示有限 阅读全文请下载本文完整版WORD文档

上一篇:ASP中一个字符串处理类(VBScript)   下一篇:ASP中令人震撼的Debug类


共3页 9 7 [1] [2] [38 :>

2009-1-8 23:50:16
本文的相类似文章
  • 让你的错误提示更生动
  • 在学习中进步 在进步中成长 教程中国相随您的成长之路
    华腾联合科技股份有限公司版权所有
    广告联系:Rosibo@163.com