- 在线时间
- 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")) * p5 q! s1 X% g$ {+ x, ~/ Z
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
* i0 Z4 g0 A$ \+ KEnd Sub < >'***********************************************************
8 Q- p% l- f( B% v! _1 T'* PrintDatabaseInfo - y, v' P. R+ f* l4 v
'*********************************************************** ) ~- W! T% r& G4 H
Private Sub PrintDatabaseInfo(byval DivSetNo)
7 H) a T' F3 Q1 t/ k8 T) E dim tbl 2 e z6 ~. y3 R5 x
tbl = MakeTable(dbg_DB_Data) 7 ]) v; ` d- y. z/ h
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 9 j/ E& c7 ~( i) P# o1 R" y
Response.Write replace(tbl,"|", vbcrlf) 7 ]) D/ k7 j( U+ z) z
End Sub </P>< >'*********************************************************** " G; R) L+ r: i7 {! ^) x% T
'* PrintCollection & V$ ?8 i) U2 m( p
'*********************************************************** ) M5 p/ t; X, L/ O
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
& a3 x& F: b( Y* n Dim vItem, tbl, Temp ! Y Y0 {( H' f4 v
For Each vItem In Collection * A4 Q/ A. g* a- C
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ' K/ D& f7 G/ {, D
tbl = AddRow(tbl, vItem, "{object}")
5 p9 J- ]1 t9 p$ b elseif isnull(Collection(vItem)) then
' x) R: P1 \ {# m8 ^0 ] tbl = AddRow(tbl, vItem, "{null}")
: P4 J" j: [) v% u elseif isarray(Collection(vItem)) then ' w6 |3 _+ `# b9 B
tbl = AddRow(tbl, vItem, "{array}") , i: U$ _: F% I, K2 t5 k, n
else
2 g9 g4 L- {8 q9 \: X& W& `! n; y if dbg_AllVars then
/ ]' k9 N3 }+ C' x) Y tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
+ e R- A; N( e0 F. e: l elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
6 L# O( | s# \3 K9 M if Collection(vItem) <> "" then
; M& j- @/ S& F! }' Q tbl = AddRow(tbl, vItem, server.HTML9 G5 R6 B, u, T2 g+ q1 j$ F
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") + ?$ E0 L. s' c6 A, y m" ?* l
else
4 a2 i# }4 q) t8 P tbl = AddRow(tbl, vItem, "...")
2 X% P1 Q# |, T: c4 j end if 9 @( F; X2 L6 X
end if
' j& {/ [* \ f2 X+ t end if 3 X0 g& i" ?( d. O/ H9 q8 L
Next
% a; k5 D# t2 P5 s3 o if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
, q/ O3 j5 U) X tbl = MakeTable(tbl)
- e) d7 c9 a. l* [ if Collection.count <= 0 then DivSetNo =2 / }9 D+ o5 {9 H4 D2 s
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
4 u- @% K! V% `- A8 Z0 v tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ i. H9 E& R1 s$ x Response.Write replace(tbl,"|", vbcrlf) 4 w& i) v" v8 P$ r4 [9 [
End Sub
3 {+ @6 C. W) D2 w
' S# o; a" }8 P'*********************************************************** 9 J' q$ g( `( q. y6 h0 {
'* AddRow X) ~0 ^3 ?1 W3 k# _1 [
'***********************************************************
2 T3 j5 P' m! G8 c# w4 IPrivate Function AddRow(byval t, byval var, byval val)
5 b% n7 n8 }% r6 I6 w7 R t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 0 x0 s: y; }9 W2 q
AddRow = t 2 i6 c7 \( @( r% r
End Function </P>< >'*********************************************************** 3 V2 I; |( t# Y6 ~* Y
'* MakeTable
" t4 j$ I3 ^( J( J'***********************************************************
; x- p) s6 N4 L& A" @Private Function MakeTable(byval tdata) 3 s2 ~0 w; c: @2 r
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 8 Y( `* P0 j7 O: A# d
MakeTable = tdata
, p/ e; S6 P5 p8 x0 xEnd Function </P>< >'***********************************************************
9 |1 t# g6 P) D( v+ k, |9 d+ i+ Q''@SDESCRIPTION: Draws the Debug-panel
5 X! `9 q% f) z0 W/ ^$ x5 A3 {, T'***********************************************************
, k* {& J: q- w5 b. H, BPublic Sub draw() $ G( q2 E+ t/ d3 T& O e
If dbg_Enabled Then
1 c! ?2 u; z% u, q8 E dbg_FinishTime = Now()
$ I5 _; L0 W7 [2 ~9 d$ [ 7 n% j7 J4 V. _+ f5 O
Dim DivSet, x 8 V w* G+ j( U0 h
DivSet = split(dbg_Show_default,",")
' {! D. b% F) ~/ A dbg_Show = split(dbg_Show,",")
1 s$ L9 J+ a* F- p! S
& J0 H6 v( z7 | For x = 0 to ubound(dbg_Show)
+ g. r6 C/ K' }( a. } divSet(x) = dbg_Show(x)
' e+ K2 p/ y: {5 r) T' ~, H& w Next 1 t+ o0 A4 h w) W( h
8 w2 o3 { M/ u, K( m3 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>" ! G% Q6 |( S( K* s# m1 ]
Call PrintSummaryInfo(divSet(0)) 1 D5 E \. e3 s$ k$ E/ a/ H
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 9 b) s; ]) m1 c2 {# j. F: P
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
6 |8 R) `, R q3 W" B! i Call PrintCollection("FORM", Request.Form(),divSet(3),"") - o0 P, @0 Y, S. Y, v
Call PrintCookiesInfo(divSet(4))
8 W0 v3 `* r- R" s( K 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))
. a- c" R7 H2 e0 b% C5 b5 |6 _ Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") . Z7 m. A+ E) c4 c- a
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
, p& |6 q7 d9 n/ r" V* e# z" l s Call PrintDatabaseInfo(divSet(8)) & E" M1 x% y3 m" k; r
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
( g) p0 O& W$ j5 ~# q$ v Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
9 h3 t# Y; e1 J! ~. F4 ~ Response.Write "</Table>"
3 L; S5 s+ B6 Q+ f, A4 j, X End If
4 p1 F. [3 P1 ?End Sub </P>< >'Destructor , @7 g' J1 I1 f
Private Sub Class_Terminate()
" H. V. b* y) L! q7 @& N0 |2 p8 C Set dbg_Data = Nothing * ?3 \( L" Y( v
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >/ a3 _6 b3 S8 s
CLASS debuggingConsole 2 x& p, }& t: T6 h* a! ]0 N
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false : |7 ~/ b! y- N- x' d% {
&n6 y! D3 P' {" d" t3 N
bsp; " b. C: b( }% F+ }
Property Get Enabled===[bool] Gets the "enabled" value
* Z8 p3 }4 f X7 l( P; K- A 8 h- {' H, g. L4 v2 A
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
/ K( [/ B! g4 B, L& z A. G5 A ! D1 D' ?7 t+ O$ ~# F6 s. T
Property Get Show===[string] Gets the debugging panel. - ^2 C% u6 p2 M+ r1 r, s
0 q5 q' _. o7 E9 b( 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>< >-------------------------------------------------------------------------------- - ~' h" D- d+ p" ~( Q, [0 }
Public Methods </P>< >public sub===Print (label, output)
- a% W& Y. t/ |' s/ O. e Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
1 N& E# n C* e) S3 n/ L Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () , \7 R2 L" X4 ~1 M) w7 Z6 _' u
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
. {9 Y8 m4 r) y% K% n+ q; Y/ ]1 zMethods Detail
W5 M! y8 E/ ~1 i/ s ; I1 @4 W4 @' O1 L: y+ p
public sub===Print (label, output) 0 R2 ?, M! d% j. _! q5 B' z. V. e
Parameters:
5 n7 S9 y X, w7 i3 j1 K# R - label [string]: Description of the variable
3 a2 H- R; h: M1 j2 s - output [variable]: The variable itself
2 t$ |3 \5 L: T7 L) ^4 a( R% g {
6 j% R8 c5 D) U& o. q9 T( \. r& X/ F( Jpublic sub===GrabDatabaseInfo (byval oSQLDB)
) g/ i: p8 ~5 W3 h# X0 JParameters: 2 g4 R) D! l% |
- oSQLDB [object]: connection-object</P> |
|