- 在线时间
- 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 |9 J5 D- H# }( v dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
, X* h) Z. [8 `6 x6 q* aEnd Sub < >'***********************************************************
# `: U* P B6 f1 K3 K'* PrintDatabaseInfo
) `9 D! `; n& w6 U' S/ D'*********************************************************** $ m5 O, v! |5 o
Private Sub PrintDatabaseInfo(byval DivSetNo)
: k; Q; s2 _( s dim tbl
4 x& d9 `# }$ W: D2 Q tbl = MakeTable(dbg_DB_Data) : |0 N! X+ f& O9 l
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
" L2 p1 y9 j# [! ` Response.Write replace(tbl,"|", vbcrlf) * o* e6 f: R. i8 ]4 e* _
End Sub </P>< >'*********************************************************** 1 c3 ^. a+ K# e0 A
'* PrintCollection
( @; M- q$ o* @4 D! [5 R'*********************************************************** : P" b! m0 P4 G& ?8 T
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
# t9 I' C! Q# G* m Dim vItem, tbl, Temp
, \# n2 `& R( g% l For Each vItem In Collection 1 m& X) e0 p$ J M3 d$ f
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 2 O7 G/ S8 t; l' V' X; X% O: L# ~# O
tbl = AddRow(tbl, vItem, "{object}")
! b: `" X) R( _( ~, e elseif isnull(Collection(vItem)) then
! F% J# a) |/ r8 T, J tbl = AddRow(tbl, vItem, "{null}")
! e' G- x" D: `, m- A* l5 l) g elseif isarray(Collection(vItem)) then
; W% H$ S3 N, [- i tbl = AddRow(tbl, vItem, "{array}")
4 ^' E6 x+ |2 E7 N1 r, p) V8 I else
/ @& l' V* R6 Z& Q if dbg_AllVars then
/ t( B7 y" c7 J- F tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
9 _6 `" S( h* j+ s1 e$ D elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
' {7 T* q3 z4 O; ?& K5 N; W if Collection(vItem) <> "" then
, i. h: l3 b1 q; F8 { tbl = AddRow(tbl, vItem, server.HTML s+ t/ C5 |2 d9 d8 v u7 ]( z
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
2 v$ |& Z; I \6 P; ~ else
5 J0 j" e3 `/ z- |, e tbl = AddRow(tbl, vItem, "...") & u* A: N/ t# R, Z1 I( ?2 p
end if + ?% @! A w& n% V3 e
end if
; `1 k7 H/ \% j# j9 O( S end if ! H2 F+ M" q/ ^
Next ! b2 } J/ o9 T& C
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
, L' ]6 J" E$ t1 N tbl = MakeTable(tbl)
) H4 Z3 L. [% S; R1 p1 O: k if Collection.count <= 0 then DivSetNo =2
3 K; x& o# a8 b tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ' x$ i5 p; u$ A5 |
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
6 B. ]) T4 T$ ^2 ]8 v; b2 f Response.Write replace(tbl,"|", vbcrlf)
9 w% E' X4 K* }& uEnd Sub u! R- ~5 k6 x- K
3 L5 F: [# u+ A2 d
'*********************************************************** 2 w, x' u# i( B5 x( l) ?' {
'* AddRow
8 j4 B; k' f$ q5 N% b4 E8 p'*********************************************************** & f4 O7 r Y2 n: r
Private Function AddRow(byval t, byval var, byval val)
- M/ ]0 r( A7 y6 G/ ?% m0 ^ t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
( o# P, {4 x0 n! Q+ M3 Q4 C AddRow = t
: Y1 m8 C w/ [* u7 k9 kEnd Function </P>< >'***********************************************************
' s, ~3 o: F9 y! _3 k" R'* MakeTable . l5 M( U% m' Q! b7 H& c
'*********************************************************** + v0 ?6 a! }' E1 n/ D' i l
Private Function MakeTable(byval tdata)
A) s; g1 o! a) c tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" - l" M* S- U7 i
MakeTable = tdata 9 K! V: m3 }% z6 y: Q Y
End Function </P>< >'*********************************************************** # e0 e; Z ~5 D: d' I& I; c( Y
''@SDESCRIPTION: Draws the Debug-panel
8 H" j/ e z; r/ I- o, Y'*********************************************************** ) ~* l2 q! e/ x% Q7 P
Public Sub draw()
" i6 U$ _% v3 R$ V: g If dbg_Enabled Then
2 h9 r s9 V1 T& k" ]/ M9 ] dbg_FinishTime = Now()
% P& q% o3 G# [8 P
& H p% Z* U$ t9 t! [- k Dim DivSet, x ' n7 r- P9 a$ ]0 s% n- N! L
DivSet = split(dbg_Show_default,",")
3 W5 L$ N& y4 C, @) _ @* y1 u" v dbg_Show = split(dbg_Show,",") q1 U0 P' X' b3 s. r$ H
5 ^6 h" w- a2 e1 l
For x = 0 to ubound(dbg_Show)
- D A+ m2 B' y K2 T4 |: y% T' C' u1 u divSet(x) = dbg_Show(x)
% l& ]) W8 B0 k2 E3 i2 l$ q5 u Next
8 Z7 R: \/ ~. K' i Y3 x$ n
/ O" g X5 S2 j3 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>"
. F; p- n7 X! L1 a7 _9 q Call PrintSummaryInfo(divSet(0)) 2 K4 Z) {& {% C
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 5 j2 I9 p$ H6 X+ {) }. s$ r* s
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
, h' ]( |. [1 J( N. X( m Call PrintCollection("FORM", Request.Form(),divSet(3),"")
( h: z- I* j% g! I# f0 [ Call PrintCookiesInfo(divSet(4))
) L8 W$ ~+ U9 _$ f. U7 j 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))
5 E# T7 r2 @7 e8 S1 o8 W Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ( C% R+ Z' q: R$ v0 `* | n
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
; W7 D0 \9 m: W% i Call PrintDatabaseInfo(divSet(8))
" k. S5 p+ o/ i G' s Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") " Z4 r: g/ m5 [$ O: M6 q, w
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
3 Z: N! |+ g1 ]0 ~2 S6 k9 Q Response.Write "</Table>"
% i9 j( ^9 ~( h2 @ n End If
) c! g; V- B# _- ? vEnd Sub </P>< >'Destructor
* b" x/ a7 V' X" D9 t XPrivate Sub Class_Terminate()
& _# c$ O J A( D' J Set dbg_Data = Nothing h1 L5 Z, R% o" |; ~* t2 o
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
' s9 b9 c- {0 xCLASS debuggingConsole
1 a o, {. e$ @; M; g" Z/ S2 L7 gVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " a6 k# a% d6 Y6 X9 G+ h+ l
&n
0 O- G9 R+ G2 {% d6 |9 X4 h6 g% e$ Kbsp;
5 D$ L" H% T8 `. F* J; BProperty Get Enabled===[bool] Gets the "enabled" value & A; t. `6 [2 |8 X: r- Z1 N
# V7 M7 \3 k# D' |# fProperty 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
/ L3 ?% O7 G7 h. H8 z3 X
4 Q2 }1 Q5 x! `. ~# q; E$ V! bProperty Get Show===[string] Gets the debugging panel.
. D Q! W) `9 b1 O ; [* Y& A& I' n! w: W
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>< >--------------------------------------------------------------------------------
- O5 Z: y& X3 _+ B/ T1 B& N5 {+ @Public Methods </P>< >public sub===Print (label, output)
C7 l4 C+ _3 d! X Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) ( B) h6 @+ j+ t# c1 M/ b# U0 z% p/ v
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () ( `2 F! x' X( M8 D3 g T
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
6 k/ g$ N m3 [" O# s5 N# m; Y. hMethods Detail
( ?2 v3 l4 B8 z2 q3 I5 o. j
0 G! e1 s5 Z* N, s: B5 tpublic sub===Print (label, output)
2 P, L5 ]; l! e: Q* FParameters: $ \0 C: Q- i m1 C$ ^8 X* C
- label [string]: Description of the variable
4 e9 S2 f( ~$ \ X - output [variable]: The variable itself
" q" Q; ]1 p0 Y; l1 u6 m
7 B7 d8 A/ `* f! u; {1 jpublic sub===GrabDatabaseInfo (byval oSQLDB) , B2 L1 u0 A* p/ j, B8 M
Parameters: 2 U2 {& B& {( }& g9 k
- oSQLDB [object]: connection-object</P> |
|