- 在线时间
- 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")) $ k4 A2 r) a! K% X" t5 W
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) - d2 x4 I; N6 A: u4 ]" Z9 w
End Sub < >'*********************************************************** ' B- w* x; Y+ H0 J n
'* PrintDatabaseInfo 1 o# j S g% X2 V
'*********************************************************** % r( {' K0 V# }' [7 `8 ~
Private Sub PrintDatabaseInfo(byval DivSetNo)
M: n- s0 W% g dim tbl " C# l v6 f; y+ v
tbl = MakeTable(dbg_DB_Data)
' U( u- V$ x! o" C3 S tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 4 w( `: F' ^8 F2 z& f/ F
Response.Write replace(tbl,"|", vbcrlf) a6 ]" u( t. e- ?# j1 L
End Sub </P>< >'*********************************************************** 7 a- {- w7 B7 O$ m0 \
'* PrintCollection
+ s* M# ~: u$ Y; F" e$ }8 ^& n'*********************************************************** ; d# Q7 a4 _- M3 c
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
2 S, q! x% n0 F" R7 J' f( @+ I Dim vItem, tbl, Temp ( r3 ^3 @; |& E' H N
For Each vItem In Collection ' p9 {+ P' o$ h0 D' i% k% J
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
) X) f, z# p6 J# w6 f tbl = AddRow(tbl, vItem, "{object}") ( ~$ y% r( g& |. s% _
elseif isnull(Collection(vItem)) then " F% s9 m1 R# w7 b8 A. B
tbl = AddRow(tbl, vItem, "{null}")
6 C/ i) f* z: {7 Q, m elseif isarray(Collection(vItem)) then $ T# W' w* S3 {6 G- O( R
tbl = AddRow(tbl, vItem, "{array}") $ O: }% U# U( I0 ]0 Y
else
4 D w; N& m, H$ q$ v+ j; \* e if dbg_AllVars then
6 k7 x. z+ V, ^" r tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
3 Q& C& E/ I. Y5 [. D! {5 V; t C elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 5 y; i0 H- N: A
if Collection(vItem) <> "" then % |; {7 N" H4 C
tbl = AddRow(tbl, vItem, server.HTML" s* S, |- W) h; w
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
: B1 [( l$ Q' N; i: U4 R3 T! C2 ~ else
3 P' d& d' L) `' l3 m( l tbl = AddRow(tbl, vItem, "...")
3 C8 ^7 r, x) i8 K: z& m end if
; m& ?+ @+ T4 j/ p R: z end if
+ n9 `% @3 e; o/ O4 L7 O. C G end if ' E# X- h: u4 U; H7 h! C3 ~3 ^+ o9 |& i- W
Next . ~& e |: W" i- l2 _5 {. b g) i
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 1 g- k0 l0 ~ {( ]
tbl = MakeTable(tbl)
' H2 K% b1 V( r. ~* d2 y, q if Collection.count <= 0 then DivSetNo =2
1 Z* _' s7 P m+ C6 m1 c tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
+ O: h4 t5 f: u, U/ A2 E tbl = replace(tbl,"#sectname#",replace(Name," ","")) & v& ?; P$ N# E
Response.Write replace(tbl,"|", vbcrlf)
5 O" ?2 q, n cEnd Sub ) w8 n' ^" g' N- j3 i- x T
' G; u; i/ @0 J6 o1 g% `: X8 v
'*********************************************************** ' G. V1 l c9 K$ L5 I6 a# p
'* AddRow
; X2 u5 S* G3 c( y7 h'*********************************************************** , g/ K, r2 ^5 ~! M, C
Private Function AddRow(byval t, byval var, byval val)
- _# C, X7 p/ a9 E2 g% ~ t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 5 Z; D B# Y4 x
AddRow = t 4 ?& e9 Z ?, W8 @- z$ y5 \
End Function </P>< >'***********************************************************
4 b" U) r0 V" F& v5 J9 X'* MakeTable 7 A. L0 P5 N/ T
'***********************************************************
) k$ v* z( F3 _9 G/ B2 ]Private Function MakeTable(byval tdata) 7 v% T4 R7 @; F/ W2 J. F, ~
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 7 g& \5 _+ n3 _3 V; }
MakeTable = tdata
/ u+ J' W) Q4 a4 p1 e. j2 JEnd Function </P>< >'*********************************************************** : J7 n+ e1 d/ z& y& c
''@SDESCRIPTION: Draws the Debug-panel
$ O3 ?: u8 }# T& ]7 n'***********************************************************
: z- T. G8 t2 w4 w) HPublic Sub draw()
, X/ V7 ]% |# d/ `8 i If dbg_Enabled Then & |8 M9 a1 V0 Q; `/ @8 l( s2 O
dbg_FinishTime = Now()
7 h3 Y Z E$ a! O* Y# w" r Y ; B& [, _( q5 r- A+ C( t( T
Dim DivSet, x R2 e- c* E& C' Q5 N d
DivSet = split(dbg_Show_default,",")
8 R: E0 H: G& G+ x" y* q dbg_Show = split(dbg_Show,",") * o S- p0 D2 g/ m0 ~
7 n0 C5 @7 V. |. _4 A
For x = 0 to ubound(dbg_Show) 5 Z+ u% c: ~! x# x$ e" r5 Z- z3 [
divSet(x) = dbg_Show(x) + U& R! |9 L B" @. g' @/ T
Next
5 V" l# e+ C- }6 l
& p3 f$ X. p% 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>"
3 R6 I) t, Z) t' h# L" H Call PrintSummaryInfo(divSet(0)) 0 J F$ O7 r7 R4 L" _
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
: H3 s9 w* |/ \* @# H& U* Q, i Q Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
6 O, c! i5 H% S* c) {' m* B Z2 { Call PrintCollection("FORM", Request.Form(),divSet(3),"") + d0 ]3 A2 D" z4 e; t4 I e
Call PrintCookiesInfo(divSet(4))
6 f: V# ~* D) l% n, |% x: ^0 p 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))
% Z: X& V* @& Y1 u1 c& O! t Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 5 Z( k5 f2 }* g3 l/ E
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' b D+ @# D8 _( D7 J; ? Call PrintDatabaseInfo(divSet(8)) & h3 y7 F/ E4 T9 ?/ }$ v! n9 |; P
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
7 M X/ c! N3 @ ~8 A Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 3 T9 N3 R8 z$ r h$ p9 J: i
Response.Write "</Table>" , M. N+ \/ f% w; P( z6 j ^
End If
, f9 t- x6 W3 P) v) IEnd Sub </P>< >'Destructor 7 B4 ?! S( d% l1 Q( t
Private Sub Class_Terminate() 4 R H/ P2 [1 g3 I- j. r
Set dbg_Data = Nothing ) Z7 o; I% l) `" P4 F' Z
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >- a" y) E+ L; m. T
CLASS debuggingConsole
* E) M( D6 k/ p T4 w7 q$ j: l# }" }Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false ) N+ Z/ t Y2 ~) R
&n
# Z/ l* p4 _& b5 tbsp; " P& \# B2 |3 z. p! Q. q2 Y
Property Get Enabled===[bool] Gets the "enabled" value & {- R4 C' `) h& [1 n3 S6 B' `, @
5 q( N! A) E( M7 f+ X, mProperty 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
; {2 ^7 n5 p: A! h3 K * q3 w) ~5 c8 n* }
Property Get Show===[string] Gets the debugging panel.
0 p" K5 M2 T/ K7 _
1 u2 P' T7 I. z, ?. g4 BProperty 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>< >-------------------------------------------------------------------------------- ! e! @, i! e* r3 B u
Public Methods </P>< >public sub===Print (label, output) 0 I t, M t0 ^& `! x
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 4 f' S x+ R5 @* Y* V
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
/ t$ l$ t7 p4 d9 Z+ ]' U% q- t Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
4 q! D8 j' |+ U& v% U- qMethods Detail
( Q/ ~" B1 h; I0 t! ^' O3 k9 F 9 c! z) a+ l" C {
public sub===Print (label, output)
! S- ]% ?5 w; v$ uParameters: & L2 Y* F3 _/ o! L: t
- label [string]: Description of the variable ( u3 c$ u2 `+ r. u: l+ O
- output [variable]: The variable itself % C5 A" m/ J, x' ^, }) @6 J
) b0 L+ M) `* J+ ]
public sub===GrabDatabaseInfo (byval oSQLDB) / @+ N. N- ~% s1 ^) ~8 H+ ^3 @
Parameters:
7 Q) [0 z" |2 f. v - oSQLDB [object]: connection-object</P> |
|