- 在线时间
- 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")) . |' V; _6 { j+ {. s* O5 F4 A
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
) @, x" j8 o% D* j% CEnd Sub < >'*********************************************************** 9 E* o6 r" y# c/ N+ W' R0 L3 E9 ^
'* PrintDatabaseInfo
( W3 ?' Q: m, F/ h9 ['*********************************************************** ! @8 ~% v) Q- n2 \. s8 v( H% B; x
Private Sub PrintDatabaseInfo(byval DivSetNo)
; x- U2 L, F. S6 J1 Q5 Y dim tbl 5 Y" ^. t! x& y6 H7 g
tbl = MakeTable(dbg_DB_Data)
0 s5 G( z/ B. l2 s5 ~; L tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
( A+ b/ y+ s& |. g. F8 @ Response.Write replace(tbl,"|", vbcrlf)
; |8 i+ V, e! LEnd Sub </P>< >'*********************************************************** . d- [- S: ^8 S7 e6 d6 O
'* PrintCollection ) \$ o2 K: T5 X1 b4 U
'***********************************************************
' B8 q0 f0 p* u0 Y, ]Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) + k' I& a3 _- p9 B
Dim vItem, tbl, Temp
* l0 m& T+ N: ?+ q1 c For Each vItem In Collection 7 u7 ^( E8 }' c+ D, j) y# i: D
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then # a' x5 O" P4 s6 d
tbl = AddRow(tbl, vItem, "{object}") 0 t9 O8 l5 W& F
elseif isnull(Collection(vItem)) then 3 {: M5 {- g( z# q" T) S# z3 A
tbl = AddRow(tbl, vItem, "{null}") 6 u" y6 d( M. |7 G
elseif isarray(Collection(vItem)) then 2 U( M* ^& c: b, _9 C
tbl = AddRow(tbl, vItem, "{array}")
3 t3 E) s8 \+ z1 a& F) ~! b else # ^4 Z) h) x$ E, Q; f
if dbg_AllVars then 2 x7 n! I! `* P! O) }5 b
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) o" `) f; g2 M6 L: G2 F
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 9 C! s2 a- k5 M0 g$ V: r4 g
if Collection(vItem) <> "" then ! ?, f9 `8 R2 b$ W
tbl = AddRow(tbl, vItem, server.HTML) Z6 N" f* y2 }& _( C ^& l
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 5 w8 O, ? t8 l& \& o' L0 X/ d
else
$ t6 `8 ?. ?) c$ M: o `1 E tbl = AddRow(tbl, vItem, "...") 3 X1 m+ F- C$ V
end if & j% l+ h N" H$ Y
end if ; r) |' e4 l8 Y% j1 _4 |
end if 7 ]% Q. @, k. B5 [
Next + k; ~8 z* r/ z& i# ^, K
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 9 u# i8 S; b- D
tbl = MakeTable(tbl) ( e% y7 N- Q$ {
if Collection.count <= 0 then DivSetNo =2
0 O4 F$ H9 E$ L tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 0 z6 }! U4 ^. k4 j( H) [
tbl = replace(tbl,"#sectname#",replace(Name," ","")) 0 {" R2 J( o0 s! W s1 n# @# N' M
Response.Write replace(tbl,"|", vbcrlf) 9 G: T: z* [& r9 e; ?; ?
End Sub " U1 I/ G! |$ h2 u
h. s& j- O3 x% V8 T6 E'*********************************************************** " p1 P4 A9 y* q6 l
'* AddRow ; `* A0 J; ]$ q0 I
'***********************************************************
1 v; @; w v5 v- d+ Q+ APrivate Function AddRow(byval t, byval var, byval val)
: j( N/ o5 F0 m) Y t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
3 s8 C2 ?4 H2 e+ X# D AddRow = t |% C n& x5 {) C$ g
End Function </P>< >'*********************************************************** ! `3 P) Z# D. }2 c0 ~
'* MakeTable
. }* s/ G5 p/ ]' ]'***********************************************************
* x$ a# o* R9 GPrivate Function MakeTable(byval tdata) $ a/ {/ ?: ?* I; O: N: T& `
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 6 g$ I( Q5 z4 \0 V+ |
MakeTable = tdata
' j3 u+ u4 [# s! LEnd Function </P>< >'***********************************************************
0 i% a% V/ A9 Q8 @''@SDESCRIPTION: Draws the Debug-panel
4 E B( v* L3 L. u; N'***********************************************************
, _" \# p) f' z+ U2 SPublic Sub draw() # G+ v( i5 N9 Y* I9 L0 ?* i. `- x
If dbg_Enabled Then
$ {: r0 ?, V$ d( a0 T1 _ dbg_FinishTime = Now() * P, |5 q. J1 r8 p
5 q1 L1 y; r$ N9 \* `9 s$ K9 b- d Dim DivSet, x ; z9 Q# L3 U9 E
DivSet = split(dbg_Show_default,",") Z$ c6 ? Z9 O7 h; g, H
dbg_Show = split(dbg_Show,",") 0 n. L r4 N$ B8 g S9 [' A- ^
$ z' K' K% K) ^
For x = 0 to ubound(dbg_Show) $ Y' w% F: ]# |& |; H9 u! X
divSet(x) = dbg_Show(x)
$ X' _/ ?! v1 [4 F Next 9 _+ x) x8 H; X( o7 g
9 S$ X" g% B0 p4 `( n- ] o 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>" 3 A( c: n3 Q7 @' R+ t
Call PrintSummaryInfo(divSet(0))
, j; u9 O3 r, m: t2 {4 O8 L" M* r Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
/ Y, P0 Q6 e3 i5 b. M/ d; _* V: t/ r Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
, O% u4 m3 u/ U* k" M/ l) { Call PrintCollection("FORM", Request.Form(),divSet(3),"")
8 |) Q* ^+ @, f+ z2 A) E Call PrintCookiesInfo(divSet(4))
N, J: L% R- y. m' c 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))
9 w; U" I1 a; k, t# f" F) ?( I" J Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ! F% U# q! U% e' L% z; n" e
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
; n8 d: J4 J* M Call PrintDatabaseInfo(divSet(8)) 8 M' D V, A4 t; ~1 H6 L3 l7 t) K
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
& T, J6 y% T7 c' C2 G) d" @ Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") ! r3 R0 Q' O( S+ I: _
Response.Write "</Table>" 7 [- a+ M! z4 z& B. e7 Y' v
End If
- R4 w/ K4 `! g" U! B; PEnd Sub </P>< >'Destructor + f* A9 Y, r9 Q" v# \
Private Sub Class_Terminate()
' w9 c# v5 e: _# @/ F Set dbg_Data = Nothing
1 U! P( m3 m( \1 ?. s4 zEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >9 d/ }- y) I! h6 Q! p7 }- J# U
CLASS debuggingConsole ' w8 q$ N! w' J' E
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
- R- ]( S8 Q7 q9 f; J5 e D&n
% ~; d2 l' d- D2 L- Absp; 2 T6 P4 b4 S; P* f2 ]
Property Get Enabled===[bool] Gets the "enabled" value * J5 \( B3 ~& y4 m; s" {
: {% H* K8 ~9 G7 S: j1 I
Property 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
* U. q4 ?: O/ j% ~. w5 j& c% M5 K 5 |' S1 ]$ d7 h$ j J
Property Get Show===[string] Gets the debugging panel. 8 C5 u% ^* N: K5 \
% F9 G" Z" c) l. x1 ]
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>< >-------------------------------------------------------------------------------- / L) u( y6 j! v6 z
Public Methods </P>< >public sub===Print (label, output) , K' s8 Z) r1 y# H8 S# f/ q
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) - K8 Y& l- ?9 i! }9 \" ^
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
+ V Y3 s; h- E; I7 E) r/ _ Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- + y) x1 {4 a p+ z0 b" `4 [/ E! v
Methods Detail
, Q4 J' ~: O7 s' v . l. h4 V7 f& }; L8 l3 b
public sub===Print (label, output) ! j( H/ a' s8 w$ @
Parameters: 1 x1 u. G# v7 a5 D( r
- label [string]: Description of the variable
( c9 e+ `8 [/ R6 D - output [variable]: The variable itself ! \8 z# C5 F% o- C" }7 ~1 F
3 o0 H, [# G2 x% F9 @
public sub===GrabDatabaseInfo (byval oSQLDB)
- z+ j4 i s3 p6 K) jParameters:
2 K9 |) t, A2 n - oSQLDB [object]: connection-object</P> |
|