- 在线时间
- 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"))
% a6 L* M) ~" d; X Z; r dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) 6 X8 p; n4 P: q4 Z! [
End Sub < >'*********************************************************** + r3 T2 d$ n7 y" d1 r4 j
'* PrintDatabaseInfo
' _' @3 M, r% l, {/ F'*********************************************************** 6 }; \7 v. F8 r$ }
Private Sub PrintDatabaseInfo(byval DivSetNo) , U; Z* X2 w, q5 t! i8 o
dim tbl
% T- ^4 S& J8 L* _ tbl = MakeTable(dbg_DB_Data)
0 d' U# B7 @0 E# H! c tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
. b3 j5 d$ B3 u/ H Response.Write replace(tbl,"|", vbcrlf) & }( }3 f) P9 q* Q/ K
End Sub </P>< >'*********************************************************** ( H/ Z8 ], P0 [3 N6 M0 X. K' S5 ]( Y
'* PrintCollection
7 k$ y' o C. M+ d$ g+ @'*********************************************************** 6 O* P( V# H: `2 Z3 z3 y) ^
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
6 L0 f* D+ B8 `: W9 A) @ Dim vItem, tbl, Temp 5 k @2 I) v8 |/ [, A
For Each vItem In Collection
3 m) L) p; ~/ R" h+ B- ~ if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then / h, Z/ k5 Q8 N) K
tbl = AddRow(tbl, vItem, "{object}")
4 {3 V9 A. r9 R A0 d* b' X% { elseif isnull(Collection(vItem)) then
! Y: A% U! K$ `! ?* p8 G1 t tbl = AddRow(tbl, vItem, "{null}")
) o- T5 k: o8 I; v" c ~, u/ U: q* ` elseif isarray(Collection(vItem)) then
0 b" ?$ d- B, T. I. V tbl = AddRow(tbl, vItem, "{array}")
; u; J2 f% C6 T+ f else
+ T U" k9 v7 }5 c1 z2 r" Q9 x if dbg_AllVars then
. X Y# ~; n! X tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 3 x. ?- d, K! ^5 e
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
2 J6 l- G: `9 z if Collection(vItem) <> "" then - L7 v: Q9 \ [% l. t
tbl = AddRow(tbl, vItem, server.HTML
+ t" k0 T3 z o g, H% e) A4 HEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") ) v8 J% j* b! s e2 V( _# j
else
: E4 S0 ?' u& Z0 Y# j+ D0 K tbl = AddRow(tbl, vItem, "...")
" n+ L/ c3 w. s' \' S4 g: x/ V) y end if 7 V3 }, Y7 o8 e: {# f% T
end if ) J, E* J i% o# s* X
end if ; Z2 |8 s; l3 {. H
Next
3 u( [: P: Y a9 A if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 0 Y, L6 k8 ?0 V
tbl = MakeTable(tbl) 8 o; s9 a2 i1 n
if Collection.count <= 0 then DivSetNo =2
% Y1 h5 l8 }9 i B, x/ S9 r( b* e tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) & y0 S) K9 ~& V. T# B4 h& S5 A3 K
tbl = replace(tbl,"#sectname#",replace(Name," ","")) % a' Q1 [! E |2 x4 C; j. S
Response.Write replace(tbl,"|", vbcrlf)
4 M( C1 {& W- `, jEnd Sub 2 U, j0 Z9 g7 u8 V
+ m! z2 n$ V, S2 p8 i
'*********************************************************** % j* j/ r/ e6 p
'* AddRow
) \& {* e$ W7 n7 o" c! D'*********************************************************** ) S7 n3 M- O. _& ?3 [7 Q( m( P' Z5 m
Private Function AddRow(byval t, byval var, byval val) 8 \( U9 w: V/ E, C/ q7 o
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" ) c6 `8 f7 V- C' u1 ]
AddRow = t * s- A7 v2 X3 r$ r' D
End Function </P>< >'***********************************************************
! @. x# {, _ u! E'* MakeTable : r: M3 j* L3 L: \7 N
'*********************************************************** 4 B* ~2 E4 h3 l
Private Function MakeTable(byval tdata)
, f9 r" ]2 Q+ h* |" _ tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" " Z4 m3 c3 Q3 ?
MakeTable = tdata
5 y) m5 D8 Z- W2 L3 @5 G: iEnd Function </P>< >'***********************************************************
4 Q2 I4 m# O7 I( L''@SDESCRIPTION: Draws the Debug-panel 3 g5 S S5 L( y
'*********************************************************** * A, P2 D- n; }+ P, z& N" Q
Public Sub draw()
) K! U s5 O o& P! n6 ?' ? If dbg_Enabled Then
+ @8 q$ E6 ^! b9 A) e dbg_FinishTime = Now()
4 \2 d! J5 g: p+ d% W4 d2 d/ e" x W ! n7 d J2 o- z7 s+ t
Dim DivSet, x
2 X% j! x0 C$ Q/ v DivSet = split(dbg_Show_default,",")
5 s1 i/ w4 N( N) C4 e dbg_Show = split(dbg_Show,",")
" r4 ~) }/ R2 @2 H4 W/ B
/ M9 _; d8 s% x% z) x8 x Y For x = 0 to ubound(dbg_Show) 9 X( u: b8 n. l |
divSet(x) = dbg_Show(x) 3 D. A% j' n1 K* w6 i- n. w/ ]
Next ! H4 a" W* X9 o7 e8 j" d
6 T$ k/ ^# Q; [
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>"
( {/ G+ d# y# W/ g& l Call PrintSummaryInfo(divSet(0)) / c1 Q0 I: w. c
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
8 h3 c; o1 i* t9 ^9 I- ~ Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
# g+ r3 i' C& R. r Call PrintCollection("FORM", Request.Form(),divSet(3),"")
2 R0 @6 T' J0 S$ a4 ~+ m0 C6 R% F Call PrintCookiesInfo(divSet(4)) 5 a0 X9 }5 l* M" ~$ L; 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))
/ a* X) {% _5 h# ?; ? Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 4 ?/ `& W. S7 `+ b$ |
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' F. T: T- F1 M7 k4 ?; i: v0 }% ] Call PrintDatabaseInfo(divSet(8)) 5 O( @6 K8 o/ i2 c' O
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") : N) p3 O Q! ?) k9 b2 E
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 0 r- A& Q4 \* K. O2 ]4 w' b; j) X
Response.Write "</Table>"
! c2 [0 u4 O) ~0 ^+ t5 l" C) T End If 9 }! K, P0 Q! u" k. E& ^
End Sub </P>< >'Destructor
9 W: N' l9 ^7 y {9 FPrivate Sub Class_Terminate() : W h0 Y- \& i5 \' L
Set dbg_Data = Nothing 4 p. Z3 W5 Y, w& r
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >5 @; I( b% F, y8 Z- S+ z
CLASS debuggingConsole
: H3 o6 C7 U7 S( l% t" D+ U3 `Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " z: Z1 ~. h3 f5 Y) b# h( f
&n6 A5 n9 |1 ]1 f5 ^/ y5 f0 N: g2 t+ u
bsp; 2 b( @$ L$ d% A: D. U1 P
Property Get Enabled===[bool] Gets the "enabled" value + [4 f( ~( D+ C+ i! B. e; ^( u6 O
- N' v& ]1 k: ]9 _
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 ' D: {6 G- C# v. L
: G3 G9 R( c; j3 v0 b; r2 q
Property Get Show===[string] Gets the debugging panel.
/ u) Y1 X! e- A h# @0 g; `2 P9 h) q* q8 u9 M) ]
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>< >-------------------------------------------------------------------------------- $ x# [+ F# o V' Z8 i
Public Methods </P>< >public sub===Print (label, output) `; O$ j" ?0 Z, o
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) " P4 N8 c1 m7 p5 p; ?/ K! W$ l- w
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
- ~$ U+ I3 G2 p0 p: e Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
" r1 C/ ?5 n& R) [- L! ]% ?Methods Detail
# {3 J# w; j; y e) O0 Q. ~ p3 i( z# j+ w& _
public sub===Print (label, output) 6 o0 ~, ?$ q/ z& a
Parameters: 8 m$ X/ z4 t2 ~: @6 U8 G
- label [string]: Description of the variable 7 x7 ]4 f4 k- ], O, |
- output [variable]: The variable itself
/ G; Q1 B; c% `0 \. [; u , M' i# V$ S" E, X7 j' d
public sub===GrabDatabaseInfo (byval oSQLDB)
' X$ R" K2 s- T8 q. EParameters: 0 {" l4 y% F5 q. E4 m! I' W
- oSQLDB [object]: connection-object</P> |
|