- 在线时间
- 0 小时
- 最后登录
- 2007-9-23
- 注册时间
- 2004-9-10
- 听众数
- 3
- 收听数
- 0
- 能力
- 0 分
- 体力
- 9975 点
- 威望
- 7 点
- 阅读权限
- 150
- 积分
- 4048
- 相册
- 0
- 日志
- 0
- 记录
- 0
- 帖子
- 1893
- 主题
- 823
- 精华
- 2
- 分享
- 0
- 好友
- 0
我的地盘我做主
该用户从未签到
|
(dbg_DB_Data, "DBMS",oSQLDB.Properties("DBMS Name") & " Ver: " & oSQLDB.Properties("DBMS Version")) " B5 c6 M0 d. U4 k, p6 g4 U9 R$ {* V) ]
dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") & " Ver: " & oSQLDB.Properties("rovider Version")) $ ~0 u$ t! V8 Y- C2 }: q$ h; y; |
End Sub <>'***********************************************************
6 e0 R: P4 ^. G'* PrintDatabaseInfo
! c5 C) n5 h. \) E1 \'***********************************************************
# Y& T1 w' m; P, T8 V1 ~Private Sub PrintDatabaseInfo(byval DivSetNo)
' @: ^% ?2 W; D4 [! ` dim tbl
: Z! N7 y7 A. F, Q; E5 r tbl = MakeTable(dbg_DB_Data) ! {3 j1 m0 x) q) O: S* u
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
( ~# R1 y* M& n% K% H( b Response.Write replace(tbl,"|", vbcrlf) 6 _( h8 y" c, F1 b/ X( d
End Sub </P><>'***********************************************************
% s. J& F1 F4 k5 n: ]'* PrintCollection
' @- z% V2 Q- h( {. l'***********************************************************
" {! F. J9 o3 GPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
% s! P- a u" ^5 l9 [ Dim vItem, tbl, Temp
$ z& Q. F% _" W H% ]5 {" W For Each vItem In Collection 4 O6 U$ _* v! o3 k
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
; l7 ~/ h0 Y# e0 l4 }8 h tbl = AddRow(tbl, vItem, "{object}") . I0 B' z9 o4 l* Z7 I& ]- s
elseif isnull(Collection(vItem)) then 8 X: \8 z! n- P8 S1 o: k0 a: Q
tbl = AddRow(tbl, vItem, "{null}")
Z) z( T E, V elseif isarray(Collection(vItem)) then ^9 Y8 \, U7 g3 Z8 m r
tbl = AddRow(tbl, vItem, "{array}") - ]- W6 |( Z+ F* f% l' I
else * I8 p1 \/ x7 } m
if dbg_AllVars then : D1 i" Z2 n5 U7 u+ h
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
: h, i# k* w* A$ D0 O# k4 G elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
/ X% O! Z Y% I if Collection(vItem) <> "" then + a. r% x- q1 d" d" T; G
tbl = AddRow(tbl, vItem, server.HTML Y* n# t$ n+ v+ i& R0 g/ e
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") , V# A- s% g' j0 o5 Y0 b1 \
else
* K3 p: l+ A. f8 K2 a1 h tbl = AddRow(tbl, vItem, "...") 3 ^2 I- B/ o6 v, F' g& B
end if $ k4 x+ \ ~8 X5 e! C' Y" n
end if 1 Q( q9 t: a4 \
end if 1 i3 l6 a; Z% K7 |7 {
Next
" I% t$ t8 I8 s9 J if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo : W4 h+ E) Q/ o
tbl = MakeTable(tbl)
) T% ~( _# m D/ B2 R$ Y if Collection.count <= 0 then DivSetNo =2
, j L6 M! p( K, P4 A1 ~* ~3 R, s$ F" C tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ) q& ~' d- N7 b$ g" u7 G# K
tbl = replace(tbl,"#sectname#",replace(Name," ","")) k0 {2 O. K5 Z
Response.Write replace(tbl,"|", vbcrlf) " d0 R0 s. l) T2 M
End Sub 5 u5 [0 M' V& T
0 A5 k# I- X- C9 }) \4 M; A) N8 ]
'*********************************************************** & U' _0 Z5 ?) i$ t
'* AddRow 8 c: i: j0 E4 ^* \
'***********************************************************
! u; a, o& p5 c) ]8 UPrivate Function AddRow(byval t, byval var, byval val)
% X e3 I" k0 E7 c7 k7 y9 k t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
& K1 z1 V( O% ?6 R; }) E2 P AddRow = t
) u; e2 K, b* }5 z7 K3 iEnd Function </P><>'*********************************************************** 5 a% |0 i" W3 [0 e- P( f5 ^6 r
'* MakeTable
: N! F9 Z/ j5 `4 o'***********************************************************
8 R: p' K$ r4 `" R& x IPrivate Function MakeTable(byval tdata)
+ O1 R: t6 r5 }" X, G$ e: M& L9 m tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
v1 { o% Y8 m8 k$ S1 b- y2 q MakeTable = tdata
( E" r6 \+ Y5 I% S' s6 u0 pEnd Function </P><>'***********************************************************
0 |! x* G3 g3 l& t4 ^" M''@SDESCRIPTION: Draws the Debug-panel
' U6 d# D. Z( ?* h! @& n M2 f$ Z'*********************************************************** / y% @7 R- y: F8 A, z5 @4 Y$ ^
Public Sub draw()
( G( `9 V# @7 N5 b3 X If dbg_Enabled Then
5 C2 R- Y+ H8 d) Y dbg_FinishTime = Now() ( |# E+ j Z: O4 g4 J, }
' K$ T2 o$ A8 l2 |- ]: \' ?5 e Dim DivSet, x # T/ m# `% H; I. G: W
DivSet = split(dbg_Show_default,",") 7 p' ?/ V; h% P4 B+ c) p) e
dbg_Show = split(dbg_Show,",") / ?2 h1 I* g6 e/ _
: t# U: p3 a0 r; @- j& j
For x = 0 to ubound(dbg_Show) # I& E! B' [5 n8 a
divSet(x) = dbg_Show(x)
, n8 R0 v( P% h* K3 f) E9 [$ i1 [ Next
# E9 L1 X! T+ D3 y6 `
7 W% Z3 N4 S1 Q/ \) j& C& C5 j: J 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>"
$ r8 K; U9 h" p' n8 |) I9 I; Z Call PrintSummaryInfo(divSet(0))
5 p7 t$ {' O/ R h* ?# J3 _$ r' X Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 5 ~4 \8 a: E9 t7 Y9 u; ?; ^
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
; V8 j% [5 T- }$ } Call PrintCollection("FORM", Request.Form(),divSet(3),"")
e! c* f9 \" S/ `6 h' f! J$ B Call PrintCookiesInfo(divSet(4))
& i& B$ t: m4 l. T7 ~6 |: m 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))
# O6 q, _4 u1 g Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
9 ~% m4 D* \- V2 @# z Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) % i. \5 D, ]7 Y- t4 O0 s8 i
Call PrintDatabaseInfo(divSet(8)) - D9 W: m3 Z. O$ G7 ~( L
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 6 }! F0 v( z2 Z0 V; c5 C( @# H
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
! M$ m/ |, j$ x8 P4 R Response.Write "</Table>" 3 u( d* C: Z, e/ K( g9 Q5 U
End If
) ^" w( d' o/ U8 I- x) R( wEnd Sub </P><>'Destructor 6 V7 O1 a4 A: m( N; T6 E$ N
Private Sub Class_Terminate()
y; n4 {$ N8 z% R3 x* h Set dbg_Data = Nothing
- w b8 c. o' q. k4 yEnd Sub </P><>End Class </P><>%> </P><>类的说明: </P><>2 Q7 R E2 C5 V& u" q% [+ n2 Q
CLASS debuggingConsole 7 b+ A$ l8 F% e2 U, ^. T8 O6 x3 X6 O
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
8 S$ v' y/ l$ e+ U1 d u5 X&n. G: d, {6 U. W
bsp; " H- N e2 o2 w- l3 D
Property Get Enabled===[bool] Gets the "enabled" value 1 p) W( B: h# P
+ s) [: D6 S' W4 DProperty Let Show(bNewValue)===[string] Sets the debugging panel. Where each digit in the string represents a debug information pane in order (11 of them). 1=open, 0=closed % X4 v2 T6 Z4 `: w
+ D v j$ ` F, n
Property Get Show===[string] Gets the debugging panel.
1 Z" Z" V- `. f & ^. z. Y9 V9 k' w ]- z+ F
Property Let AllVars(bNewValue)===[bool] Sets wheather all variables will be displayed or not. true/false </P><>roperty Get AllVars===[bool] Gets if all variables will be displayed. </P><>-------------------------------------------------------------------------------- ( d4 h2 T- p3 q, U
Public Methods </P><>public sub===Print (label, output) 1 k9 [$ g0 x1 C) O
Adds a variable to the debug-informations. </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
/ ~$ P7 g' o- M+ d Adds the Database-connection object to the debug-instance. To display Database-information </P><>public sub===draw ()
6 j1 t K' v8 r" D8 m5 f Draws the Debug-panel </P><>--------------------------------------------------------------------------------
4 ` R9 }- E \Methods Detail
0 a" F) H' [8 D7 O
3 |2 h) k4 h* F% S/ v |3 wpublic sub===Print (label, output) ' s4 }1 _) B* S- p: d, i7 n# R
Parameters: 7 `: e2 H8 y. j& y8 M
- label [string]: Description of the variable 8 C0 ] ?( k; h* T# _! @3 a
- output [variable]: The variable itself
. A0 w3 C/ ?. R) E. I; A7 ?. `
2 n! q! Y2 D6 a/ Cpublic sub===GrabDatabaseInfo (byval oSQLDB)
9 Z' [! q+ y- R N- ^8 r* V& qParameters:
, J0 ^; G3 I& c; Q5 v' u1 k - oSQLDB [object]: connection-object</P> |
|