让你的错误提示更生动[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 snowcloud2002 的 blog

默认的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)

本文关键:ASP,Error,IIS
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top