- 在线时间
- 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"))
% F( E. j6 h! R$ B! D( m dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
1 Z2 _2 {8 y% N! ^, DEnd Sub < >'***********************************************************
! z* k) q0 k7 F" [2 u+ g# N W'* PrintDatabaseInfo
7 E1 I0 F- t1 S' d'***********************************************************
9 [6 R$ J# f9 t! N; p. W. m0 vPrivate Sub PrintDatabaseInfo(byval DivSetNo) 2 A, `& R% o' k/ W% ]
dim tbl
; u$ D n1 V, j" W) l& C tbl = MakeTable(dbg_DB_Data) . k5 Q% x' \' M" C8 e, @ T4 D9 Q {
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
7 T! O! I) r% u Response.Write replace(tbl,"|", vbcrlf) j6 N/ S+ L' t% m) O
End Sub </P>< >'*********************************************************** 3 Y! W# }1 M4 J) h" P( Y
'* PrintCollection
7 A' T4 K$ [" G'*********************************************************** ) K; Q: g3 d" y8 d8 l$ C) N
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) " i- H4 M9 T% c. s. Q6 v2 i
Dim vItem, tbl, Temp
& L/ t% l3 Z; k For Each vItem In Collection
/ S o) l5 I( `% V) } if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
6 U& E8 p: @$ b3 i tbl = AddRow(tbl, vItem, "{object}") 4 x) a! ^9 O8 [
elseif isnull(Collection(vItem)) then
3 ^* J+ Q9 _# P N tbl = AddRow(tbl, vItem, "{null}") , p( F `$ N5 a) v, _
elseif isarray(Collection(vItem)) then
+ {" h' L6 K" Z6 P tbl = AddRow(tbl, vItem, "{array}") . s6 h% N( u& m; B' l* { F
else
( U+ H% t* |1 G if dbg_AllVars then
6 V4 n4 V/ N( I tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
5 E) B4 S a( W8 x" F0 I elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
' z3 |$ P$ }; c @; p' q6 b1 @ if Collection(vItem) <> "" then
3 x, T2 j# w2 f tbl = AddRow(tbl, vItem, server.HTML7 v7 j7 d- A6 l$ A7 G; l; e- p
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") + Q Y T/ J- D& K3 J% |5 p
else % d3 _5 h! R9 x& V$ u
tbl = AddRow(tbl, vItem, "...")
* C. ~1 F+ s# W9 H/ p end if % W1 k' ~0 \2 R3 n! W0 D* E6 b
end if
% T0 _& S4 ~0 g' ] end if
; o5 l5 f1 ^. R1 _# K: H Next
4 |) K$ A9 J! @! l9 j* s, S if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
" y( n( ~+ ~; Y, z/ a tbl = MakeTable(tbl) 2 L7 v& v+ ~+ p2 x
if Collection.count <= 0 then DivSetNo =2
2 e, n& l' Z3 p( V! K tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 7 }1 |( C' J3 ~. K! Q: ?) Z& ?& U
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
' b6 f1 T- }( j Response.Write replace(tbl,"|", vbcrlf)
+ W, a$ j$ t# {7 Z, M) G* u! U4 REnd Sub ) t" r3 l* T3 j' b! J
+ s+ u9 w b, X/ z% {
'***********************************************************
8 f! E: [! P0 x- r" ^7 j' ^'* AddRow
$ N0 b! m; a+ A! W2 t" n% z8 }'***********************************************************
$ d" F9 m& F) E g& bPrivate Function AddRow(byval t, byval var, byval val) ' y! f/ ^2 X; }3 C+ y, i
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
- |5 l* e; e0 z; v AddRow = t ! V# ` M! k3 K+ z/ k- p; \
End Function </P>< >'*********************************************************** 9 t9 V: b! a5 W1 N7 @
'* MakeTable * w$ U, D" q% q
'*********************************************************** 5 N. L% G( H, b# X; t
Private Function MakeTable(byval tdata)
- n- K8 b3 e3 x) r# B5 f/ w tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
+ t q5 b; M' o& g" M- K+ G MakeTable = tdata
- |; e+ |5 h& e! f0 b0 JEnd Function </P>< >'***********************************************************
0 T) i" [8 {, X& R''@SDESCRIPTION: Draws the Debug-panel
5 W5 x* i. k; M'*********************************************************** 0 {+ b6 b3 ]( i( ~' t
Public Sub draw() 1 F' h+ \; @& @* a) C1 u. I
If dbg_Enabled Then - T$ v# ?- J% n/ G4 t
dbg_FinishTime = Now()
% d/ h; d, L' |5 O. h, D2 } : @) u# P& B/ v* n$ a" x( D K
Dim DivSet, x ) l9 i; d6 n# j$ [& j. u `
DivSet = split(dbg_Show_default,",")
1 r2 `" x* N* d0 D8 B# n dbg_Show = split(dbg_Show,",")
0 H ^9 W M! c/ P5 O% D% T
1 G3 L6 ~/ L0 V For x = 0 to ubound(dbg_Show)
0 z a% X: d) b$ p7 o8 h ^ divSet(x) = dbg_Show(x) * d( m( H: i% a8 u
Next : d( V3 n5 e+ G7 C
. ]; G6 i6 |. M9 P6 \ G$ t 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>"
9 }, O; D4 N' L" N. W Call PrintSummaryInfo(divSet(0)) * u( [/ A6 @3 ~: l) T. x. \
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
9 f9 u% A k: a7 ^/ L. S0 ?& ^: ? Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
8 x7 \. i, A4 L Call PrintCollection("FORM", Request.Form(),divSet(3),"")
& Z+ u9 ?6 b q Call PrintCookiesInfo(divSet(4))
) ]7 y* H) p3 E! v4 W h5 [3 n 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)) * f& i7 b: p* ?: I" F* d
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 6 b& [( G8 K' v* _
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
$ \) v2 J3 B; _ Call PrintDatabaseInfo(divSet(8))
; q. U% X# _) R2 w& B9 o7 K+ r. x Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 5 S3 E' \* k' b) \
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
0 R( S; P1 K3 X5 e: ]6 q Response.Write "</Table>" & h5 a: u# a' }! O! S5 p
End If : c: P6 c4 [3 m9 c5 ?
End Sub </P>< >'Destructor ( A- B) k4 N! \: _5 @7 v
Private Sub Class_Terminate() - R% A5 C/ [3 ^. I7 v8 E0 h
Set dbg_Data = Nothing 6 g9 F, f5 F9 m$ N5 ^: q
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< ># R" n( i1 H9 w- X
CLASS debuggingConsole 1 F% ~3 y+ a$ N: H) A, t. S
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false Y4 n$ ~1 ^* _% P. U0 E/ x- e4 V
&n$ r) B0 U! L. u1 _( W
bsp;
6 m. M6 S( K0 H; _0 N# n0 w- d7 ]Property Get Enabled===[bool] Gets the "enabled" value . \: A. M+ z5 ?" R3 j& }
3 K5 a; s: D/ ~4 n% p! R, l4 Q
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 - p. P* z }( {' z" ]: q9 J4 R
- ]$ j. x) K: e1 w( CProperty Get Show===[string] Gets the debugging panel.
, G" A) d1 O4 z B; I/ X" u2 b
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>< >-------------------------------------------------------------------------------- 4 f, z: y9 z% s/ n$ T! k9 a
Public Methods </P>< >public sub===Print (label, output)
- D7 C; F0 u% s; Y: ~1 J Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
# I, h6 L5 t+ m/ Z6 s Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () + a7 p6 [3 o: f; }- a! t+ @: _4 P
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
; X+ r' f5 m3 T, aMethods Detail ! `, Z! ^: Z2 f. D) O$ m
4 a) _" T+ k! M3 Ipublic sub===Print (label, output)
. t4 Y/ U% f; I/ Y/ nParameters:
% J0 Q# _9 M, ^) \7 o6 v4 k1 D! C - label [string]: Description of the variable ' {. y1 g( K* Y P
- output [variable]: The variable itself 7 ~1 } Z+ Q- v! p& z% ?
" M7 ~& Q9 O* m# D! kpublic sub===GrabDatabaseInfo (byval oSQLDB)
- q, u5 k% d4 |! yParameters:
. k0 N. ?0 N4 X1 R9 q1 Q - oSQLDB [object]: connection-object</P> |
|