- 在线时间
- 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")) + b, j0 Y9 j @
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
0 i5 V5 L% z6 ~5 rEnd Sub < >'*********************************************************** ( R+ i; ^2 w" w, V
'* PrintDatabaseInfo ) U0 _) f: A; L# Y" a8 i
'*********************************************************** * Z) |* `8 [3 ?, ?% d
Private Sub PrintDatabaseInfo(byval DivSetNo)
, g* r ^1 ~1 K4 K dim tbl . |$ u& o* l5 \7 Y7 ~
tbl = MakeTable(dbg_DB_Data)
9 ?$ z, d: J( B B1 m tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
! @. O$ n( V3 P4 b Response.Write replace(tbl,"|", vbcrlf)
- B6 F' ]# ~! R4 D4 A9 qEnd Sub </P>< >'***********************************************************
4 R) U3 g, p: M c. y3 c'* PrintCollection
: a9 B' |- o1 a+ ^'*********************************************************** % d2 j# j1 U8 h' \
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ; Z% j6 z3 _1 p' Y! M/ E0 c
Dim vItem, tbl, Temp
8 D( U- m) ~: Q. ^, n For Each vItem In Collection
3 L$ A0 @1 I B1 |* z/ v2 _ if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 7 b; z8 f: O" ]0 N
tbl = AddRow(tbl, vItem, "{object}") - n4 r& I$ e1 v( Y3 o
elseif isnull(Collection(vItem)) then
$ |' t$ z4 k( D b tbl = AddRow(tbl, vItem, "{null}") ; D! |9 _. r3 r4 b& [
elseif isarray(Collection(vItem)) then ( }2 I3 }; |2 @" M8 z7 F. q2 O
tbl = AddRow(tbl, vItem, "{array}") 3 K' \* P& h' q5 q* m( c+ m7 j
else 8 t: {! |+ v8 O! z+ K; O
if dbg_AllVars then
: J2 D( S: X% t2 B3 O$ V tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
4 {; M1 S" ]' K/ Z elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 8 C: |8 w7 o! i" T W+ t |
if Collection(vItem) <> "" then 5 X. q7 H$ Y0 d3 A: l
tbl = AddRow(tbl, vItem, server.HTML- s- J# a( E1 D) N) W! n! D7 \8 _
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
) m5 J4 j% ?4 k7 L) n else
: M/ @+ l- I i8 D/ s" x; B8 K tbl = AddRow(tbl, vItem, "...") ' A* R) }' ?# h1 `
end if 3 s# O; I! B9 t- [9 g
end if % Q8 F7 k2 n) B) c, i) W
end if
0 |3 R* p7 ]5 k1 X1 E8 C7 q Next $ s' y9 A9 n; Z/ e$ |. t' t" ^
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo ; v& S) v- m2 }5 O$ H
tbl = MakeTable(tbl) 9 A4 u. Z% F9 h. y7 r
if Collection.count <= 0 then DivSetNo =2 5 r7 d& D* K$ m0 Q5 j* X
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 9 J1 T# O: M# R. V& ]+ o
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
1 c% v8 C! ?) d: c- O* l Response.Write replace(tbl,"|", vbcrlf)
7 c" B' I" r" x/ b; I( @End Sub
: u. Y" K9 k: N- }3 i( x % i9 A+ M! P3 m' G2 E
'***********************************************************
4 S* n2 M8 s$ [1 o! S'* AddRow
* R S# _% `/ t x. B'*********************************************************** ( V- _* a0 L0 ~4 O* O
Private Function AddRow(byval t, byval var, byval val) * w2 w+ T. Z1 F/ z J' {
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
. W$ I u, G7 K6 l/ ~ AddRow = t * Q/ A' `- M$ |& t5 W0 r
End Function </P>< >'*********************************************************** & C2 X1 e8 c+ ]* q( ^2 |; R
'* MakeTable 0 [/ m8 o. P0 W6 N
'*********************************************************** * D. \: {2 E4 G N G
Private Function MakeTable(byval tdata) 3 n1 ~, ]5 _# R/ m# O0 B8 E0 A
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 1 ?/ z) u! v5 [2 t
MakeTable = tdata 8 c5 @' [% ]/ `$ p; B
End Function </P>< >'***********************************************************
* C! f% W4 \! S6 |- ^$ ^9 d''@SDESCRIPTION: Draws the Debug-panel 2 {; b7 U" O8 X: D
'***********************************************************
0 H" v6 |7 ?! B2 DPublic Sub draw()
9 u) B7 i4 q, _7 e3 P If dbg_Enabled Then
' Y- ` z' t% N& f* b+ W* _9 d dbg_FinishTime = Now()
+ f# p$ F* Z$ V' H( e& x ]; A ( m+ V, L4 X' K# U) V
Dim DivSet, x
" h( y5 \ j3 k3 j; ~5 A DivSet = split(dbg_Show_default,",") ( q. G2 Y8 o& F8 q% Q9 m
dbg_Show = split(dbg_Show,",") 4 t2 h/ X+ j( G' V
5 z- ^- t H' ]* q) [ For x = 0 to ubound(dbg_Show)
4 e. @, t7 R' E- ^9 R; c' G% | divSet(x) = dbg_Show(x) + l) K- k5 p# b. t$ u
Next
q6 l" j. V. ]$ e
) a, ]; f& ]7 p! |, V @. 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>"
- e# N# z6 m3 E7 H( M Call PrintSummaryInfo(divSet(0))
8 c* R! E; f. X. n, J( p2 n* h# ^ Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
' C" w6 K# {# Z% T Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
- Y+ U# g8 \/ e* k# E9 @9 D- }8 @ Call PrintCollection("FORM", Request.Form(),divSet(3),"") ' X' n- Z6 e4 s" O! t. m/ x' _: G
Call PrintCookiesInfo(divSet(4)) 3 z5 p: z) r: m7 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)) , v, T" X f. s- B c( p* h. l, B
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") e6 R0 X/ O* u3 S! h0 A r
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
- g4 P6 L4 G: Z( p* w" v& P Call PrintDatabaseInfo(divSet(8))
! r& G: \/ }: X" |& d6 Q4 X Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 4 [$ |" E9 b5 p: ?( Q, Y
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
; v7 A' ]' @: _/ A( x Response.Write "</Table>" # u$ [1 o( }% O& w8 y P- k* z, H
End If
6 k, Z% Q, I8 \* C# }; `/ ?+ fEnd Sub </P>< >'Destructor + Z- @/ s, b# T b% ^+ M
Private Sub Class_Terminate()
9 ?- l- |+ v3 w Set dbg_Data = Nothing / G( U5 t+ l$ m7 C* Z
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
* @1 r; B# l' }6 SCLASS debuggingConsole
& ?. b: @' y* T5 o cVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
^* e8 a6 `& [; V&n6 b3 q* G2 d: O: D
bsp; ' B! p: }5 c! [# [* V" y
Property Get Enabled===[bool] Gets the "enabled" value
* o s4 q6 b% t& K$ W, ~' n3 w
8 c, n' l2 h% D2 Y: EProperty 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 f; A* L' k1 e! Y$ [
# n# ^1 v y, gProperty Get Show===[string] Gets the debugging panel. * G: A1 g: z: `3 Y, C! w+ D
" G! @- j2 l; S( C- L9 T6 W7 V
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>< >--------------------------------------------------------------------------------
3 j, l5 |$ [0 \Public Methods </P>< >public sub===Print (label, output)
6 k7 k' W5 ?0 u1 O5 A$ u& | Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
( l& B2 H1 I" E! |' f7 g" e- r Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
2 }% j* T/ v* k( D( K z3 w+ P5 q: M% t Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- - P1 U1 C6 T: M- W' ~+ O
Methods Detail " F' l. B1 u, [7 z7 _* Y
1 V M" ^# |" H" A
public sub===Print (label, output)
/ n% H# i2 j1 m3 ^" m dParameters:
% ^) K! h$ e% T- I - label [string]: Description of the variable + ]6 s- K" R. P' \- b
- output [variable]: The variable itself
8 |$ K( _# q& L9 ~; H) C 7 c' g! T, c r0 ]) s: V- q
public sub===GrabDatabaseInfo (byval oSQLDB)
$ J* X! z$ w# V1 e. p3 \% `* G, `Parameters:
7 v8 M4 L+ X3 i8 A" S - oSQLDB [object]: connection-object</P> |
|