- 在线时间
- 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")) 3 ]2 |4 f6 x2 E; {8 Q2 ]
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) $ R) w* Y% q" X
End Sub < >'*********************************************************** 1 T3 j5 ~1 H3 F4 T1 h2 `2 O$ j0 v
'* PrintDatabaseInfo
2 N! B7 ~7 R: r5 Z* x6 O. ~, v' L. `'*********************************************************** ( b, ]: H2 `+ Y8 Z
Private Sub PrintDatabaseInfo(byval DivSetNo)
7 k/ ^$ [; J3 q& G, _/ P dim tbl
! W) y8 u3 S6 T. f& I tbl = MakeTable(dbg_DB_Data) 4 F [5 o3 }) Z8 o5 z
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
" _# z7 }' U( R- K: U/ f' U Response.Write replace(tbl,"|", vbcrlf) ) j! I1 }$ V: C0 f
End Sub </P>< >'***********************************************************
2 {+ g) }- Y2 e; b% `& e'* PrintCollection ! }. ]0 \; l o+ t6 F3 F5 i0 `4 I
'*********************************************************** $ L5 D; k- e9 C) `( |+ h) S5 I) Q
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 9 c g$ L- I& J- A& V
Dim vItem, tbl, Temp
+ I e3 I5 Y% F For Each vItem In Collection
0 o+ C- G, I8 b if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
7 v m, U5 s3 [5 \2 ~! Y2 f tbl = AddRow(tbl, vItem, "{object}") + W4 F9 W5 E/ L% B
elseif isnull(Collection(vItem)) then
" y# u8 j; {4 b- l4 S tbl = AddRow(tbl, vItem, "{null}")
% q( d8 b7 M) M! V! Q elseif isarray(Collection(vItem)) then $ U7 L% ^0 z. k$ x4 f' J7 R- q
tbl = AddRow(tbl, vItem, "{array}") 1 u, X. n' m0 g( u0 }* [; W2 z" Y- ]
else
1 G/ D) g- h- Y if dbg_AllVars then ! y: k0 B8 U$ c9 J2 k3 Q6 K
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
6 n- t+ f# I) N. l6 y& X elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
' w) p1 p( ?, P; |7 A if Collection(vItem) <> "" then
, w8 P2 v! d5 D1 M5 {1 \8 ?- m tbl = AddRow(tbl, vItem, server.HTML
+ p7 {3 g# s* H3 o1 [3 bEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
, v' q- {: m' i4 L/ P0 r6 H" t1 ^9 { else 1 K+ g; J# W6 R5 ~+ j+ B c( I
tbl = AddRow(tbl, vItem, "...") 9 J, A, n; k! E# G5 R
end if
' f H" Q9 `$ o end if : F" B' c$ M7 Y6 }* J& G
end if
: B2 _, E) m4 n Next
5 S9 T7 v6 T9 A if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo ( R9 S0 S& E7 ?( a2 k [
tbl = MakeTable(tbl)
' H! F8 Z9 t" _' t% Q: S, C if Collection.count <= 0 then DivSetNo =2
$ R( b/ ~7 P- I4 m" o. P- f7 k# J' b9 c tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) * y2 u; z9 p r7 J% W8 L
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
. j! I3 s! l- Q% l/ g1 u' v, r% X0 E Response.Write replace(tbl,"|", vbcrlf)
( S N- n m- ]- Y4 VEnd Sub 6 w1 `! Z& Y. }" D2 Y
3 X5 i1 T5 K7 y V4 p
'*********************************************************** * a+ d( M, ]! M7 _
'* AddRow
$ [7 l3 {) \8 U4 E* c9 T4 X; N: D'***********************************************************
7 Y, y' j3 ~. E) D+ B+ APrivate Function AddRow(byval t, byval var, byval val)
; }- O' Y- }5 }( `" {7 a t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 1 i$ }- j& [% d: I: S
AddRow = t
# p" n6 w2 @7 \/ G7 Y. |. fEnd Function </P>< >'***********************************************************
+ H* |* k4 Y8 {+ h ~/ f8 x'* MakeTable
0 L4 I( S" j/ B( f& \3 B'***********************************************************
5 ~4 m9 U5 w$ B1 S& U7 MPrivate Function MakeTable(byval tdata) 0 T& d, |2 i8 ^, V; P# g3 m/ \
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 3 G% Y( I* C1 K# Y9 x4 Y& ]
MakeTable = tdata
5 t2 `% `$ D5 B: }End Function </P>< >'*********************************************************** - W8 S& r# } I; u3 M& g
''@SDESCRIPTION: Draws the Debug-panel 8 P+ y# C) d+ _ s0 E
'*********************************************************** 4 v% i$ J1 K3 v- D6 r, s( p
Public Sub draw()
/ D6 s3 W# g, J/ L, S If dbg_Enabled Then h% \% z/ a H7 W
dbg_FinishTime = Now()
/ F4 x! l; \$ M" U9 d
$ j5 H( C; T; I+ h& S: V. z Dim DivSet, x 3 L3 m$ k f5 d8 V
DivSet = split(dbg_Show_default,",")
0 K9 g! m0 ^; {6 d2 q" i$ X0 p4 h dbg_Show = split(dbg_Show,",")
4 w- P& O: ~/ ^* p8 N
8 W3 T3 ?* V: o/ W% ^# l For x = 0 to ubound(dbg_Show)
& @4 r+ {6 q+ a0 j. {' K divSet(x) = dbg_Show(x) " F4 F* k0 f p0 _" z }1 ]
Next
: k7 M& b3 R3 d
( Q( _4 J" g; m- } 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>"
) L. y4 E7 Y5 S! g i* _ Call PrintSummaryInfo(divSet(0))
3 f7 V; f5 B4 A! A- A' Z Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
. ~2 |! m5 S2 |: y# o Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
: j( s, M( ~% a( j Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 \4 t5 y, J+ a% |4 B( y0 Q Call PrintCookiesInfo(divSet(4)) # R& g9 v8 i, G0 l- C2 |% L1 G4 L
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))
1 V, a9 V' h7 O Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
% m# ~2 z9 S* A& e" d( ? k Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
8 Y9 [5 d* D; L* H0 q& h3 c/ H) [ Call PrintDatabaseInfo(divSet(8))
A+ N4 `4 L' ~4 W* l Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 8 t# `$ ~; o# s- }
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
( ]# w9 S" {4 T8 C3 Q. b) u) [! {0 U Response.Write "</Table>" & Z8 B8 o1 L2 y5 J
End If 7 d: t0 k1 }( W: j, \
End Sub </P>< >'Destructor 0 t1 v& _# s, ~, S3 {
Private Sub Class_Terminate() - H$ B* x5 m- b9 g5 L) u
Set dbg_Data = Nothing $ P( r1 u, ~( b; ~0 }) T
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >1 U* _& X5 u" o8 x$ s& a# O# r
CLASS debuggingConsole
# \" S. @: V4 _- hVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
6 s% j4 A$ B. q5 C&n, A. a9 o, {& I! a) {' m; y
bsp; 3 t5 k: `3 C& H. M, e
Property Get Enabled===[bool] Gets the "enabled" value
# n0 s x4 P% k( O( a. y( _4 m1 ]9 g # q" L V, F A* G4 j
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 ; _( B1 _& }, r5 Z l9 c2 W
% [9 ?) x- B' U$ `: o/ j$ M
Property Get Show===[string] Gets the debugging panel. / e* B8 n2 @- R9 T% k% x
7 S9 @/ B" N" v
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>< >--------------------------------------------------------------------------------
9 Q |# u0 \" F1 X- b7 vPublic Methods </P>< >public sub===Print (label, output) 2 p) l( F% \, N5 @3 m7 B
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) - c6 k/ R: E: v, ~- p3 I! q& Y
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
" u5 v9 ^5 R6 a) t+ L Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 3 v3 V: M4 ^, \4 d
Methods Detail
) f8 e: y' [/ {; T0 t+ r 4 E) T2 h5 `' L: [. c
public sub===Print (label, output) 7 ~8 l- G* x0 V& d. V l' K
Parameters: 1 w) S2 i% M0 D) \3 I+ D4 l: ]
- label [string]: Description of the variable
) X {) h6 J7 U7 }9 B - output [variable]: The variable itself
# i( I9 o$ H# _$ F1 O, u 9 J% I4 [# s( }! o, q D/ {
public sub===GrabDatabaseInfo (byval oSQLDB)
, ?9 ]+ @( f, a! C( W% m9 g4 {Parameters: + v6 } C) b2 U- W- D
- oSQLDB [object]: connection-object</P> |
|