ASP技巧研究:ASP Error对象的相关知识
2007-09-25 12:04:58 来源:WEB开发网这个操作起来确实很烦,看看老盖先生的在500-100.asp里面写了写什么东西:
<%
Response.WriteobjASPError.Category
IfobjASPError.ASPCode>""ThenResponse.Write","&objASPError.ASPCode
Response.Write"(0x"&Hex(objASPError.Number)&")"&"<br>"
Response.Write"<b>"&objASPError.Description&"</b><br>"
IfobjASPError.ASPDescription>""ThenResponse.WriteobjASPError.ASPDescription&"<br>"
blnErrorWritten=False
'OnlyshowtheSourceifitisavailableandtherequestisfromthesamemachineasIIS
IfobjASPError.Source>""Then
strServername=LCase(Request.ServerVariables("SERVER_NAME"))
strServerIP=Request.ServerVariables("LOCAL_ADDR")
strRemoteIP= Request.ServerVariables("REMOTE_ADDR")
If(strServername="localhost"OrstrServerIP=strRemoteIP)AndobjASPError.File<>"?"Then
Response.WriteobjASPError.File
IfobjASPError.Line>0ThenResponse.Write",line"&objASPError.Line
IfobjASPError.Column>0ThenResponse.Write",column"&objASPError.Column
Response.Write"<br>"
Response.Write"<fontstyle=""COLOR:000000;FONT:8pt/11ptcouriernew""><b>"
Response.WriteServer.HTMLEncode(objASPError.Source)&"<br>"
IfobjASPError.Column>0ThenResponse.WriteString((objASPError.Column-1),"-")&"^<br>"
Response.Write"</b></font>"
blnErrorWritten=True
EndIf
EndIf
IfNotblnErrorWrittenAndobjASPError.File<>"?"Then
Response.Write"<b>"&objASPError.File
IfobjASPError.Line>0ThenResponse.Write",line"&objASPError.Line
IfobjASPError.Column>0ThenResponse.Write",column"&objASPError.Column
Response.Write"</b><br>"
EndIf
%>
- ››ASP.NET及JS中的cookie基本用法
- ››ASP.NET获取MS SQL Server安装实例
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
- ››ASP.NET中获取用户控件中控件的ID
- ››ASP.NET中FileBytes写成文件并存档
- ››asp获取毫秒数
- ››asp.net报“INSERT INTO 语句的语法错误解决
更多精彩
赞助商链接