当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP GetLastError() 方法 (ASP 3

ASP
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO
ASP AdRotator
ASP BrowserCap
ASP Content Linking
ASP Content Rotator
ASP Quick Ref
ASP 摘要
ASP 实例

ASP GetLastError() 方法 (ASP 3


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 375 ::
收藏到网摘: n/a

The GetLastError method returns an ASPError object that describes the error condition that occurred.
ASP GetLastError方法的作用是返回一个描述ASP错误状况的ASPError(ASP错误)对象。

By default, a Web site uses the file iishelpcommon500-100.asp for processing ASP errors. You can either use this file, or create your own. If you want to change the ASP file for processing the 500;100 custom errors you can use the IIS snap-in.
在默认情况下,网站都是使用文件“iishelpcommon500-100.asp”来描述在执行ASP过程中所发生的错误;你可以使用这个默认的文件,也可以自己重新建立其他的。你同样可以通过设置IIS的具体错误报告来获得具体的出错信息

Note: A 500;100 custom error will be generated if IIS encounters an error while processing either an ASP file or the application's Global.asa file. 
注意:当IIS执行一个ASP文件或者执行Global.asa文件的应用程序后出错时,将产生一个500;100的客户端(custom)错误

Note: This method is available only before the ASP file has sent any content to the browser.
注意:这个方法仅在ASP页面没有将任何数据发送给浏览器之前才有效。

Syntax
语法

Server.GetLastError()

Examples
举例

Example 1

In the example an error will occur when IIS tries to include the file, because the include statement is missing the file parameter:

<!--#include f="header.inc" -->
<%
response.write("sometext")
%>

Example 2

In this example an error will occur when compiling the script, because the "next" keyword is missing:

<%
dim i
for i=1 to 10 ........
nxt
%>

Example 3

In this example an error will occur because the script attempts to divide by 0:

<%
dim i,tot,j
i=0
tot=0
j=0
for i=1 to 10 tot=tot+1
next
tot=tot/j
%>

评论 (0) All

登陆 | 还没注册?