- 在线时间
- 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 T" @3 p. w: |, v dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
4 `" J4 Q" S& h; Q7 I% S* z `% lEnd Sub < >'***********************************************************
1 E& T K# m1 \: ?" c5 i'* PrintDatabaseInfo
$ v# y2 D! W8 T0 p'*********************************************************** . ?, `* g B% j. j
Private Sub PrintDatabaseInfo(byval DivSetNo)
9 b& u; D0 _% h dim tbl 8 I4 }, U* E t' ]. z# N. ?
tbl = MakeTable(dbg_DB_Data)
' t2 M/ d: y* G( _% v1 v tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) . F& r- ^- [( m
Response.Write replace(tbl,"|", vbcrlf)
, i/ e' m# h' ~" u" s2 ]End Sub </P>< >'***********************************************************
! q0 W' }6 G9 U4 }4 B( Q+ |2 k'* PrintCollection
7 k! y9 v1 H5 r'*********************************************************** 5 T+ ?( O7 r3 `; C6 i
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ' j8 o) z- T3 U6 g( z
Dim vItem, tbl, Temp 8 i0 C8 t' I. e9 `. `6 {
For Each vItem In Collection H2 @" t2 w8 F& n. e! g* C
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
. I6 ~; Y% p! h, d# V' {1 y tbl = AddRow(tbl, vItem, "{object}")
. H, R u X% b( |& ^ elseif isnull(Collection(vItem)) then 5 R! u: R1 K; P4 y! x
tbl = AddRow(tbl, vItem, "{null}") ! S) X& P# p$ I, [4 C, X
elseif isarray(Collection(vItem)) then
" I8 Q7 S* C( n2 ]' P tbl = AddRow(tbl, vItem, "{array}") ; d* I2 [2 o, t# ]( u2 @: H6 y
else * m) @% j3 @, R/ n
if dbg_AllVars then ( D" x8 v1 U5 e1 K0 ]9 `
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
) J: [6 _2 ?) O; g! Q elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 3 g, {; V1 M: n5 m) y* \1 r
if Collection(vItem) <> "" then
. y( j) G0 I# ]! T Q/ p" l8 u tbl = AddRow(tbl, vItem, server.HTML# G i8 x* \. W% }3 n5 F
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") . b4 V2 d* ?0 z e3 P
else ' k4 B+ Z+ Q2 A$ W
tbl = AddRow(tbl, vItem, "...")
, q: ?* X" B/ e5 M3 ]) C end if
0 B' j) T7 Z" c! t2 U! n! i; J- T8 f end if 8 Z4 n9 c6 z6 ^* j
end if
- _' R) M8 y @9 i+ R" ~( g Next
: J q( E Y. c6 F# q if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 8 I. ?! ]. P5 A( j+ k8 q7 S$ D
tbl = MakeTable(tbl)
! @$ w" Q4 P0 V+ D6 G9 e. Z0 H if Collection.count <= 0 then DivSetNo =2 , F6 a# R" f, {7 j+ Y/ n7 _
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
) d7 D2 M6 E$ d, ? tbl = replace(tbl,"#sectname#",replace(Name," ",""))
: {( h! a1 j! Q0 b Response.Write replace(tbl,"|", vbcrlf) # u6 F# p4 l) w# f& w. p, Q
End Sub
3 w# H3 a( @6 x/ V, H. V$ e7 l 2 K& P& m: Y( l# ?( V& Y- L( i R
'*********************************************************** 3 _6 E9 n4 F7 p/ g. }; X2 f
'* AddRow
& c" S; a3 [8 n" {2 S'*********************************************************** ' w0 [' C! ~/ p" c1 [
Private Function AddRow(byval t, byval var, byval val) 2 @- C8 T+ N( B4 t+ ~! `
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" / O) f1 s9 c& j) n& t3 v# z
AddRow = t
/ m" @) G7 k: t+ BEnd Function </P>< >'*********************************************************** q9 q! D) X7 \& D. j- U
'* MakeTable 2 x8 D! {7 H; f N" V
'*********************************************************** 2 @9 o6 C6 [: j
Private Function MakeTable(byval tdata) Y5 u/ L d% Z+ i- j, g$ L
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
& u6 l2 W7 R2 ?$ b/ h+ g MakeTable = tdata ; c1 b2 z/ H' E8 ]0 G4 b" Y$ N
End Function </P>< >'***********************************************************
& J3 ?; \$ w7 G! E2 @$ s' [/ H''@SDESCRIPTION: Draws the Debug-panel
4 B( N9 T: Y! K7 j' s'*********************************************************** 2 c2 {* d: r4 @* A- {: _
Public Sub draw() 6 A& \3 p6 D& u$ q0 w
If dbg_Enabled Then 8 E; C) N3 M) h* x$ O
dbg_FinishTime = Now() 3 t' B- T1 [# J& |! U
: r7 G0 A/ F9 `# E8 g8 s4 I
Dim DivSet, x 6 ^: Z- e" w, H0 Z2 L1 A7 @
DivSet = split(dbg_Show_default,",") 0 m5 F$ K1 L. M& R2 O3 s- |! n4 w
dbg_Show = split(dbg_Show,",") 0 N$ s, ]' r- H6 P
* H+ }5 T) v* S& _# U2 t For x = 0 to ubound(dbg_Show) , j/ {0 B) G0 j" k' h4 C* c
divSet(x) = dbg_Show(x) ' @( N+ Z( @! c2 W
Next
9 u, Y+ e4 g# j/ K' q: I* j $ }2 m; |& a1 K8 @1 j. Y% D* n
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>"
1 m8 r' b# W0 n6 Y, W' E/ f | Call PrintSummaryInfo(divSet(0)) 4 O* [# W3 ?2 G1 j% v/ ]/ n5 n
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ) w. X2 ]& _0 g# O5 p' E9 v3 C7 B
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 3 k5 v8 z& h$ n3 |! k8 i: H
Call PrintCollection("FORM", Request.Form(),divSet(3),"") . u) a4 }5 E8 h$ w& S5 T- N
Call PrintCookiesInfo(divSet(4)) 9 p9 C+ W$ N/ h) Q' w
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))
7 T; Q2 S+ _3 D, k: o4 b5 s$ H Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
. P. b: F4 M1 R/ D7 T5 n6 V7 m. v Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
" H" R3 ^. G& o7 [ Call PrintDatabaseInfo(divSet(8))
1 j( o* ~" ]; I/ g C. O Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") * Z$ h1 |) }, ?* R* Z$ L; O
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
. W+ ]7 Y& Q l& W n1 p Response.Write "</Table>"
5 V3 T8 q( h' g5 M End If * k1 y* k) E' P$ s$ K* |# n
End Sub </P>< >'Destructor
2 Y. |. Y f' ?: WPrivate Sub Class_Terminate() , ~6 S. E$ P5 k3 u/ @
Set dbg_Data = Nothing
5 D( k$ e* I" ~End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
+ Z' j4 i& c5 B: q+ T- v. X' iCLASS debuggingConsole
: k: i5 b, |; x& o X2 T8 T- C* i! wVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
; S& N; M( E* c&n
H$ G; k+ M* R+ C# F3 Gbsp;
1 u) @5 n4 F; g0 S6 KProperty Get Enabled===[bool] Gets the "enabled" value 3 w: c. n* J/ t1 o1 u+ p
* ~- _" v( H3 ?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 2 `2 ?, x9 a8 l2 e2 f. [3 \
* [, @ e/ ~' z/ i5 ~
Property Get Show===[string] Gets the debugging panel.
# [8 r3 x/ z) T& `
; z# G: T8 d8 ^0 o2 M9 PProperty 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>< >--------------------------------------------------------------------------------
, J+ A0 F; E- N0 F9 x$ m2 S: ~0 nPublic Methods </P>< >public sub===Print (label, output) : W2 x Q# k5 O! Q+ G I
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) $ L" ^; V) S& ^9 I( W/ z8 X/ v
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
! i; J- v5 ~' K9 b, \/ V Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
; c5 C, _* J3 z9 q1 P* b4 a0 SMethods Detail % V0 w: ]% l) G4 A- ^
3 E9 D3 q5 u1 [: [# X
public sub===Print (label, output)
+ n; S0 ~# X: Q DParameters: 0 K3 j$ e5 T1 C9 A- O! N- F& W7 n
- label [string]: Description of the variable
/ U$ A; \! D9 ]4 J - output [variable]: The variable itself
" T, ~$ Z. N* a$ |6 g, L. B " x& z" T* h. x4 ~, _: A
public sub===GrabDatabaseInfo (byval oSQLDB) " q( Z& Y1 o) W. R
Parameters:
0 v3 t( _# ~$ D0 n- u/ p - oSQLDB [object]: connection-object</P> |
|