ASP里面令人震撼地Debug类(VBScript)(4)


     elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
       if Collection(vItem) <> "" then
       tbl = AddRow(tbl, vItem, server.HTMLEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
       else
       tbl = AddRow(tbl, vItem, "...")
       end if
     end if
   end if
   Next
   if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
   tbl = MakeTable(tbl)
   if Collection.count <= 0 then DivSetNo =2
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
     Response.Write replace(tbl,"|", vbcrlf)
End Sub
'***********************************************************
'* AddRow
'***********************************************************
Private Function AddRow(byval t, byval var, byval val)
   t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
   AddRow = t
End Function
'***********************************************************
'* MakeTable
'***********************************************************
Private Function MakeTable(byval tdata)
   tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
   MakeTable = tdata
End Function
'***********************************************************
''@SDESCRIPTION: Draws the Debug-panel
'***********************************************************
Public Sub draw()
   If dbg_Enabled Then
     dbg_FinishTime = Now()
   Dim DivSet, x
   DivSet = split(dbg_Show_default,",")
   dbg_Show = split(dbg_Show,",")
   For x = 0 to ubound(dbg_Show)
     divSet(x) = dbg_Show(x)
   Next
   Response.Write "<BR><Table width=100% cellspacing=0 border=0 style=""font-family:arial;font-size:9pt;font-weight:normal;""><TR><TD><DIV style=""background:#005A9E;color:white;padding:4;font-size:12pt;font-weight:bold;"">Debugging-console:</DIV>"
   Call PrintSummaryInfo(divSet(0))
   Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
   Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
   Call PrintCollection("FORM", Request.Form(),divSet(3),"")
   Call PrintCookiesInfo(divSet(4))
   Call PrintCollection("SESSION", Session.Contents(),divSet(5),AddRow(AddRow(AddRow("","Locale ID",Session.LCID & " (&H" & Hex(Session.LCID) & ")"),"Code Page",Session.CodePage),"Session ID",Session.SessionID))
   Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
   Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2982.html