- 在线时间
- 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"))
/ x0 D! Y% ?2 N$ U- X+ t dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) M0 W, m0 I0 U. p$ x' M
End Sub < >'***********************************************************
3 [) ^6 V$ m+ F' |'* PrintDatabaseInfo 5 Y. Z& s, y* k# H! B, r" | F. }6 J
'*********************************************************** ) P0 g M' {3 _& v( K, z
Private Sub PrintDatabaseInfo(byval DivSetNo) 1 G Z8 q! S1 c) X6 s
dim tbl
" e( I+ ^2 A: e7 q1 a1 R0 _0 ?, S tbl = MakeTable(dbg_DB_Data)
r( j- S2 t/ g+ o* _ tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 6 L3 V, }8 c9 ~% w) | B
Response.Write replace(tbl,"|", vbcrlf) ! c- F1 u3 \& {& w/ v
End Sub </P>< >'*********************************************************** ' `5 J/ T: q" l5 M# _; B3 G
'* PrintCollection
1 H$ i- \& b1 R2 g2 W# |'*********************************************************** K& \7 b) p5 j- h2 d
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ) F0 o3 d1 ^9 X
Dim vItem, tbl, Temp
4 p. e2 }) i" K For Each vItem In Collection 8 I/ k- S$ |# l) H! L
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
, D# `) R( }/ O- d, S tbl = AddRow(tbl, vItem, "{object}")
) I( _- P# i$ T7 C elseif isnull(Collection(vItem)) then 5 ~9 ~, o" w' L6 d, `: ]
tbl = AddRow(tbl, vItem, "{null}")
. U9 U( C0 s0 ~6 f8 U6 M# h' g elseif isarray(Collection(vItem)) then
4 E5 Y4 z! i0 Z8 G: _8 { tbl = AddRow(tbl, vItem, "{array}")
! B- ~% c" T: ~/ j else 3 h# V$ m0 a9 i0 S. b5 J
if dbg_AllVars then
0 N) O. I3 e0 k tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) ; r3 P* r. L4 E7 \; I: V+ x; @
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
8 q8 q2 D/ Z3 L! T3 @" n: _ if Collection(vItem) <> "" then
( m( K& s& {- N2 f$ @ tbl = AddRow(tbl, vItem, server.HTML& N% a( d5 O: s1 R8 |3 n+ }1 N
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
5 ^& q) ^% x2 E4 e else
& C8 d9 t- I' y! n7 g4 t. W, P: B8 @ tbl = AddRow(tbl, vItem, "...")
; G- m& a) d; ^- o' n M end if # {; ~* t+ w \& A
end if
1 C! q1 n/ B j/ [! V end if
2 O0 d& n& {0 Z) V( \1 @ Next ) ^: M8 h, @) P6 ]
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo / I% o+ ~+ J" P/ M
tbl = MakeTable(tbl)
; x- c3 H2 @ ` if Collection.count <= 0 then DivSetNo =2 9 i% ~! S. h1 ^. ~. K
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
3 d& f1 Y: u+ H tbl = replace(tbl,"#sectname#",replace(Name," ","")) & V2 y) N+ ?) h& u' h
Response.Write replace(tbl,"|", vbcrlf)
+ j1 ^6 P5 e- [9 U5 e) p- q# Q5 l. QEnd Sub " n# g8 z- y0 X$ A
- I. p: }4 n4 b1 J4 g8 X' G'*********************************************************** % B- n8 k9 O9 p" \& s
'* AddRow % D8 M" a) [% L' j; Z2 G
'***********************************************************
# f" |9 |. x4 A& M( Y5 v( D- gPrivate Function AddRow(byval t, byval var, byval val)
) u( m! ~- `" s2 l t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
2 c% Y% O" i1 X9 ?! ^6 w AddRow = t
& ]6 E9 k3 w0 k; ^! JEnd Function </P>< >'***********************************************************
5 B/ N, h# t; X0 `: q4 X0 V; i- L'* MakeTable
6 {# v$ o9 B! {/ I( S5 r, u'***********************************************************
5 g3 y$ s4 w |; d6 S" `; r7 GPrivate Function MakeTable(byval tdata)
8 f: J; u$ M L# W. P; k) g$ @ tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" n* g' q. T& ~. _) q
MakeTable = tdata - | Q+ [( G. ^! G9 M# ?9 s
End Function </P>< >'*********************************************************** ( b9 f4 I, c2 V6 Z
''@SDESCRIPTION: Draws the Debug-panel 2 Y. ]5 Z6 I1 Q
'***********************************************************
* s) i3 E0 v. l5 P/ }5 ~6 U, C1 g9 oPublic Sub draw()
$ J& a; C7 R- c: k& k4 _ If dbg_Enabled Then
7 E! ]2 O2 _5 ]% [' W1 S# u+ [* h9 S# X dbg_FinishTime = Now() ! v0 N* H+ W# N
$ ?; d( n" G7 l2 ^, B! {; l E% i: A" X
Dim DivSet, x
* w V4 E7 p. ?3 s DivSet = split(dbg_Show_default,",")
, M! U, _6 v2 { dbg_Show = split(dbg_Show,",")
1 F( L& A/ R) y# { N) e
. Y& O. D, l2 C) r For x = 0 to ubound(dbg_Show) $ P! E& Z4 p7 K
divSet(x) = dbg_Show(x) ( f" P' u7 \! Y0 l. |
Next
' U' ^6 \' u& g* F ) h+ ?3 I. t7 ?+ X$ A9 V7 m$ F
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>" % _& M& s9 d& n8 ` m
Call PrintSummaryInfo(divSet(0)) " A4 W! I6 Q, {/ O: p3 Y3 _
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
% F3 Y; x. b8 c% z0 l3 S& t! n Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
" T- W. @( v, X. v' d9 S) c Call PrintCollection("FORM", Request.Form(),divSet(3),"")
9 Q1 i) N: _$ N/ Y Call PrintCookiesInfo(divSet(4))
4 b# ~$ P4 J0 t( C. M9 M 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)) 8 R" p9 E, A9 X. t9 b4 J9 D% X1 ^
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
$ F: P* s% g* v2 Y# n5 Z9 Y8 n7 o Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
& h* r& A! B1 i; S9 `( x Call PrintDatabaseInfo(divSet(8))
: i6 e2 T% h: R. j5 }0 W Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") , O/ C) _. y4 l8 G
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 5 }! a0 G; D. L2 x) Y: ~
Response.Write "</Table>"
# A0 [6 n4 G$ Q. c+ h% t: E5 n5 {3 m End If
' |8 }3 y# k; r! c y+ y9 tEnd Sub </P>< >'Destructor ) \6 L6 i3 |6 f0 V! U" V
Private Sub Class_Terminate() & P! R; K# n) t! m1 k
Set dbg_Data = Nothing
& m& @ Y4 l5 IEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
' [5 q1 W8 r0 v1 g- CCLASS debuggingConsole
& p; f3 |! z6 }Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " \; I" q5 z T8 z" |9 [
&n
) M% X" i6 G; B3 B8 N' ~bsp;
' c6 g* d5 p0 tProperty Get Enabled===[bool] Gets the "enabled" value
H) y9 u4 b0 R4 m/ I# `
. |/ \1 A1 E' U- Z+ f# w% _& xProperty 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 * |. J7 j: I6 K8 r' u
" j; l4 v7 Y8 O, [: L6 CProperty Get Show===[string] Gets the debugging panel.
G$ G& d0 J0 l5 G; _ s4 J
5 s1 F$ ^+ p h- b9 A. K3 ]" Z" 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>< >--------------------------------------------------------------------------------
- u/ V/ N. r d2 \! q! yPublic Methods </P>< >public sub===Print (label, output)
& i& ?) S$ y+ S9 v1 r Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
! u& J) D+ @0 F; m! I9 Q' D+ a" P Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () , T& x: f$ ?! `3 O9 R
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
" c; C. k9 r8 i$ [1 Z; dMethods Detail
% q+ l2 Z+ x# d8 c+ T8 P 5 U% T8 K2 U, ?; S( u1 @" o \+ M
public sub===Print (label, output) 8 f/ z7 i: F0 N' P: ~* m L. s
Parameters: 8 Q9 g) w! A8 y* n$ X
- label [string]: Description of the variable 1 ?; v2 B% ~: B( v. x
- output [variable]: The variable itself
% A _) y( @1 @1 g# u3 x 2 D! \2 Q) Y3 @/ z( F
public sub===GrabDatabaseInfo (byval oSQLDB) ' l7 p0 h) D0 _3 N# b
Parameters:
7 L+ D4 j: f* A/ t9 \+ K - oSQLDB [object]: connection-object</P> |
|