WEB开发网
开发学院WEB开发ASP ASP技巧研究:ASP Error对象的相关知识 阅读

ASP技巧研究:ASP Error对象的相关知识

 2007-09-25 12:04:58 来源:WEB开发网   
核心提示: 这个操作起来确实很烦,看看老盖先生的在500-100.asp里面写了写什么东西: <%Response.WriteobjASPError.CategoryIfobjASPError.ASPCode>""ThenResponse.Write",&qu

这个操作起来确实很烦,看看老盖先生的在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
%>

上一页  1 2 3 4 5 6 7  下一页

Tags:ASP 技巧 研究

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接