放大镜站内搜索:


您现在的位置:首页 > 电脑 > 应用技巧 > 正文
关于错误信息的显示(ASP)
学生王国 ∥ http://www.xswg.com 更新时间:2006年11月23日 调整字体:

asp程序出错后,错误提示不是很清楚明白,让人摸不着头脑,用下面方法看看有没有帮助(此法目前只适合处ADO错误外的错误)
步骤一,用编辑器打开c:\winnt\help\iisHelp\common\500-100.asp
将它另存为500-101.asp备份(以便日后恢复)
步骤二,将下面的代码覆盖500-100.asp原文件,保存退出
步骤三,创建新文件test.asp,添加如下代码
<% response.write now(1)%>,存盘退出
步骤四,在浏览器中输入localhost/test.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>");

2共  1 2 下一页


相关链接
来自:Leadbbs
编辑:
浏览:
评论查看全部评论
您的评论
姓名:
请您注意:
1.请遵守《中国互联网行业自律条款》及中华人民共和国其他各项有关法律法规。
2.严禁发表危害国家安全、损害国家利益、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的评论 。
3.用户需对自己在使用本站服务过程中的行为承担法律责任(直接或间接导致的)。
4.本站管理员有权保留或删除评论内容。
评论内容只代表网友个人观点,与本网站立场无关。