- 在线时间
- 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"))
2 @3 L6 `- R( P/ M2 q$ r dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
& A4 @ u) F; v' N, SEnd Sub < >'***********************************************************
* y I6 V2 A5 R }+ F'* PrintDatabaseInfo
: I( J+ A! N1 ^'***********************************************************
9 j% {' U0 m. q- @$ y- i4 ~Private Sub PrintDatabaseInfo(byval DivSetNo) 9 n( h$ M! Z* T+ f
dim tbl # S! `0 ^' S3 Q3 S- U9 Z2 }
tbl = MakeTable(dbg_DB_Data) 1 U& Z( y/ c9 d2 j/ W
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
3 I$ x/ Z+ O9 H! x/ P9 w: l Response.Write replace(tbl,"|", vbcrlf)
! S# d% H% Z3 zEnd Sub </P>< >'***********************************************************
1 y0 ^& B& }/ n0 E% X9 l+ U'* PrintCollection
1 R. v5 o* j! R'*********************************************************** 3 c8 U7 |8 [9 o5 g, z1 o9 x
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) + r* { }/ N, I( M+ C
Dim vItem, tbl, Temp
' L, T6 G, a, j ~% j, N For Each vItem In Collection : ]7 T# t6 h0 E, }0 C# g @
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ! Z7 Q7 n7 g4 `' h! d3 \
tbl = AddRow(tbl, vItem, "{object}")
9 X0 v0 U6 }: }3 N0 A elseif isnull(Collection(vItem)) then " v9 |3 Z" Q1 C2 c
tbl = AddRow(tbl, vItem, "{null}") % R: ^8 `/ ~9 q: `
elseif isarray(Collection(vItem)) then , \' F' d' F. ^2 k" n# U
tbl = AddRow(tbl, vItem, "{array}") % M' ^3 M! A3 R
else * ]3 Y8 o7 h! l, d! h8 |9 r
if dbg_AllVars then
: d* o0 v* }3 _ tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
6 s1 D! J7 r- o: S7 G elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
+ I" E: O: y! ^2 | if Collection(vItem) <> "" then
6 @- e! H' U9 x, O2 f tbl = AddRow(tbl, vItem, server.HTML
6 D5 u) x1 |. [7 a8 T' i! lEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") ' C' N) l, c' E
else , r6 x. G2 K% }/ `& v/ s9 a; J7 Z
tbl = AddRow(tbl, vItem, "...")
$ s+ V2 g0 c7 `/ f' ~ end if # }& Q/ F$ r0 Q& w
end if . g& e+ w; U$ P5 |2 k* E
end if 3 e& U/ v- l$ }- `/ I# K) A' C
Next ( _/ g* ]6 M( b. V" p/ Y7 ]
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
2 ~9 v8 C" W0 p3 R* @ tbl = MakeTable(tbl)
7 _- Z! U: E. i( q4 }5 M! E if Collection.count <= 0 then DivSetNo =2 + t- @5 o- J3 n. e' f
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ! k1 R' G0 D0 j6 h/ K+ T
tbl = replace(tbl,"#sectname#",replace(Name," ","")) ( i x+ _: o( h( ]# f+ M1 r1 R
Response.Write replace(tbl,"|", vbcrlf)
7 Q9 H1 s0 x) P: u/ X( A. n, _5 uEnd Sub
7 G4 W5 V6 Y0 X; R7 T( Z
1 n& U; }9 H( n: {( i" o) z9 @# }'*********************************************************** . P6 s' m$ ^0 d
'* AddRow
" [- ?1 n0 Z5 h M'*********************************************************** % P, W9 m7 c5 u) M
Private Function AddRow(byval t, byval var, byval val) : r' y% M" q* g( E* r1 S
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
. `3 L3 F3 K. ~: L" R AddRow = t . m5 |; G2 \; ~( F! e: t0 c, ~! Z
End Function </P>< >'***********************************************************
3 `: }, Z7 f6 @1 @- {8 k0 S1 |# o'* MakeTable
4 |. o T" T( r( ^- b, b( Y& e: o'*********************************************************** $ Z- v2 h3 `9 z+ b
Private Function MakeTable(byval tdata)
7 J# s g: M1 g3 ~/ W( r tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
& i2 A) M9 E2 u4 `$ O0 h/ u' _ MakeTable = tdata * D( F$ G5 y" O" O$ J6 c: N
End Function </P>< >'***********************************************************
+ ^1 E% N1 H+ D% e3 U1 g) X5 }''@SDESCRIPTION: Draws the Debug-panel
! g1 U) Z9 w8 U# m4 ?# ^2 b* p'*********************************************************** 6 Y: N; `6 {! Q) B) z1 ]' i
Public Sub draw() T9 W1 i) h8 o$ W% l+ k
If dbg_Enabled Then
( d0 j# d6 h% q dbg_FinishTime = Now()
+ T1 l( w2 \) f( ] 6 y& a* l0 w0 F0 w
Dim DivSet, x
; {; J* H: U# u DivSet = split(dbg_Show_default,",")
) s7 f {$ A8 x' h1 Q( l4 r, C7 Z1 \ dbg_Show = split(dbg_Show,",") 6 R, ~9 b7 I& W$ q5 z6 w( b. o" O
4 y2 f3 G0 `; t' S) L0 C For x = 0 to ubound(dbg_Show) " _) W7 d4 I3 E7 ?
divSet(x) = dbg_Show(x) 9 k' S Z& K! E) M9 s% S( j% ?
Next
: @. S B' y& }$ N1 n1 D ; A! E: v5 c! N \& i
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>" . v8 l- |1 m; P
Call PrintSummaryInfo(divSet(0)) ! V. W( G! Z p: c) L
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
8 X" E) n9 G/ a& A! q Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
# j7 ]* J: k. ^9 E( t Call PrintCollection("FORM", Request.Form(),divSet(3),"") + O5 [; U+ ^- G D8 U, i; P
Call PrintCookiesInfo(divSet(4)) 0 i( v: R p7 Q0 V/ @1 g
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)) - `: b9 f, ?; G: u
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
7 Q" \6 f2 u3 v& y& z) n, r Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
) v5 u7 {0 c! \$ J2 X Call PrintDatabaseInfo(divSet(8))
1 s: N( u! |3 Y/ V( S, d& o Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
/ X( W, w d3 X; z Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") $ W: Z0 E4 `' M; ^
Response.Write "</Table>" % _( q) ^( m- P2 ^
End If
3 x9 j) b7 P. LEnd Sub </P>< >'Destructor
4 g. V+ Y6 j2 cPrivate Sub Class_Terminate()
3 V: I6 [; Z8 ^( N2 ~: S Set dbg_Data = Nothing P; p. h' ~+ p5 [2 ]" U& P# C5 w
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
5 b) A( O/ i0 U* y X4 u- DCLASS debuggingConsole 7 L" n4 c5 C/ B: ~: @* ?
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
' Z" \. @0 p, @0 F2 z2 v& ^&n9 K5 E: F1 `- W
bsp; # E8 F3 s5 {3 z/ A) m
Property Get Enabled===[bool] Gets the "enabled" value
, Y, Q$ Q7 W$ \# ^9 U4 ?4 z; T 3 I" U- f/ b) I% d% \* z" \
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
7 r V, i* [1 e& V [ : c1 b2 q" x3 V( N; K
Property Get Show===[string] Gets the debugging panel.
8 y" d' c; F1 q1 T5 C# S 6 M' O) c Y F
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>< >--------------------------------------------------------------------------------
k3 B; e$ Q' `( d; ~, kPublic Methods </P>< >public sub===Print (label, output) 7 ^& `9 D( K1 G) Y/ ]( Y
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) : B7 [; ~5 y5 [- u. k& A3 Z, G
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () ) Q J6 Z) Y M& R$ L
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- ' q- n" p( h) @/ U% q) y4 h! a
Methods Detail ) V) w0 ]% S; P; u ~
% ]! Z3 X. M4 [: vpublic sub===Print (label, output) ) G) G' k% ?* x# C7 D) q
Parameters:
& O N* O+ \0 P" N+ e% g - label [string]: Description of the variable
: J' L$ O3 D( i0 x6 l! I$ o1 z - output [variable]: The variable itself
5 z& L* C) }. E" l
& X( ?$ c! c# Ipublic sub===GrabDatabaseInfo (byval oSQLDB) 0 j: L) m/ }: s8 A
Parameters: 8 R6 X$ P+ A+ y4 n) ?
- oSQLDB [object]: connection-object</P> |
|