IIS 6.0,经典ASP详细错误消息 [英] IIS 6.0, Classic ASP Detailed Error Message

查看:56
本文介绍了IIS 6.0,经典ASP详细错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个传统的经典ASP网站,该站点已从IIS 7移至IIS6.不幸的是,我的应用程序出现错误,但是它没有向浏览器发送任何详细的错误信息,因此我无法对其进行更正.服务器将引发自定义错误消息,如下所示;

I have a legacy classic asp site which is moved from IIS 7 to IIS 6. Unfortunately I am getting an error in my application but its not sending any detailed error information to the browser so I am not able to correct it. The Server throws an custom error message as follows;

内部服务器错误 服务器遇到内部错误或配置错误,无法完成您的请求.请与服务器管理员联系,以通知错误发生的时间以及您可能做过的任何可能导致错误的事情.服务器错误日志中可能会提供有关此错误的更多信息.

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error. More information about this error may be available in the server error log.

我如何获得IIS 5.5中的错误信息? 预先感谢

how can i get a the error info as in IIS 5.5? Thanks in advance

推荐答案

如果您无法更改IIS错误设置,则只需让asp页打印错误即可.

If you can't change the IIS error settings then simply let the asp-page print the error.

在文件顶部,设置On Error Resume Next以允许ASP脚本即使有任何错误也可以继续执行.

At the top of the file, set On Error Resume Next to allow the asp-script to continue executing despite any errors.

然后在您怀疑发生错误的可能位置或仅在页面底部;放上这段代码.

Then at the possible locations where you suspect error to occur OR just at the bottom of the page; put this code.

IF Err.Number <> 0 THEN
    Response.Write "=========================================" & "<br />"
    Response.Write "Error description: " & Err.Description     & "<br />"
    Response.Write "Source: " & Err.Source                     & "<br />"
    Response.Write "LineNumber: " & Err.Line                   & "<br />"
    Response.Write "=========================================" & "<br />"
END IF

这篇关于IIS 6.0,经典ASP详细错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆