- 在线时间
- 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 h' Q' I f& X+ m. k; K dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) 7 b9 ^: d! ^ g3 c/ P
End Sub < >'*********************************************************** 9 p l/ `* F2 U' \3 o3 O5 w
'* PrintDatabaseInfo
/ p' q$ d& [" H- J3 U" ['*********************************************************** , I3 _0 Z8 ^/ a P6 B+ [" e
Private Sub PrintDatabaseInfo(byval DivSetNo) 2 {3 j4 V5 T/ Q9 s4 y* B8 L5 M( i
dim tbl ; s/ n9 X1 s/ g7 ~9 ]% T" t5 A
tbl = MakeTable(dbg_DB_Data)
+ T) C# B7 X$ X2 C6 S, o tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
$ s9 b; A# V3 @6 q+ z( M Response.Write replace(tbl,"|", vbcrlf) " G$ [% j, m( N# A$ G8 B
End Sub </P>< >'*********************************************************** , y5 I6 @& l! d# {, U) _. @
'* PrintCollection 5 I8 [. U! I5 V _
'***********************************************************
& t/ Q! n8 o8 ?. D: C" VPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
5 ?5 u/ v9 E- ^: C/ _ Dim vItem, tbl, Temp
5 `2 u: K! p2 s' C8 C& W9 w. U For Each vItem In Collection
" D5 v* e5 j- d& q# Y if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ' Q& C' m/ {1 G+ |' e
tbl = AddRow(tbl, vItem, "{object}")
7 B" \* K: f: }6 P$ V1 p v( C6 f elseif isnull(Collection(vItem)) then
; L. U) H" b& A- u tbl = AddRow(tbl, vItem, "{null}") & F, h; S( l% ?
elseif isarray(Collection(vItem)) then 4 T1 c9 U% k' P" ?) H6 S) ^5 u5 _
tbl = AddRow(tbl, vItem, "{array}")
. c# O; O/ Y8 c; A) A( } else ' U2 R( }$ q4 @+ _8 s
if dbg_AllVars then ) u5 U- ?9 }# r j1 v
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) ( \ F8 s6 y/ V: b- }/ G% o5 ?
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
/ G$ E" J' h0 B' Z$ z. F6 H/ Z if Collection(vItem) <> "" then
. D+ E g) r! S9 `/ P tbl = AddRow(tbl, vItem, server.HTML
( z" k( c* m. hEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
; o& e7 \. j9 \ M* A, ~. Z else 6 m, k; A+ b, S& M+ [
tbl = AddRow(tbl, vItem, "...") : x6 ]8 j: H# ?. @; T. L
end if
( U+ o! F; ^ ]) }. v! D end if / v" @" ?% N1 f, g: U
end if
+ h0 Y- p8 `& Y& _ Next : X( @( q: V: a
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo , I0 E! N# d, ?* G
tbl = MakeTable(tbl)
# T% P& Y9 J3 o) H" M, m+ w/ Z if Collection.count <= 0 then DivSetNo =2
3 I7 l6 r# W5 v: p( D& @ tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 3 ^/ ?* l# P, ?: i
tbl = replace(tbl,"#sectname#",replace(Name," ","")) * a0 t- Z1 s- K; Q- h+ s
Response.Write replace(tbl,"|", vbcrlf)
7 k% |) \( ]; \# IEnd Sub ' M/ n, A5 K! P& p1 e
' l K; Y+ B) b, E
'***********************************************************
( a% Q% G5 y5 `( w l8 P'* AddRow
$ K& e/ D9 k Y6 y' h: x) [9 f'*********************************************************** & }3 H& t1 }, W" j) D
Private Function AddRow(byval t, byval var, byval val) , A. ~& M7 A. S" S8 x, Q* D% L) e s
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
: W; e5 j: Q! F9 ^ AddRow = t & e* P3 F- r' | Q; k
End Function </P>< >'*********************************************************** + \) o7 b( k0 }+ a
'* MakeTable
1 k6 Y; [6 {8 X" h. \ F'***********************************************************
' m0 S. Y+ P6 J8 \- T0 d% y: ePrivate Function MakeTable(byval tdata) c! O W& b5 \. ]& ^
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
- z Q/ T' E* u MakeTable = tdata 8 |5 a5 W3 f2 O: q
End Function </P>< >'***********************************************************
& _& q% `2 r) h5 h6 A/ j: w. J1 D5 I''@SDESCRIPTION: Draws the Debug-panel
& B v/ C D' i2 V; W/ d1 J# m'*********************************************************** % \2 k7 h3 V( N: c* k1 R" `
Public Sub draw()
4 N/ O: z* n1 i- y/ b$ T5 O If dbg_Enabled Then
" _8 S" z$ I6 N' k dbg_FinishTime = Now()
" M5 k+ F& i& @7 G! P 5 z; P. K2 J5 |" i; h- s: i
Dim DivSet, x : v/ l# D) G5 z. } X+ |
DivSet = split(dbg_Show_default,",")
: E! d1 {1 @+ b0 P& t dbg_Show = split(dbg_Show,",")
- m8 L) {1 I! K( D$ b: ?+ A
, C% }# {! G Y9 h- R4 n* ?1 w6 Y3 I For x = 0 to ubound(dbg_Show) ' @ ? l* A' a; r5 a
divSet(x) = dbg_Show(x) $ Q+ d( X2 V8 A/ H
Next
1 _/ k7 ]7 U9 y" Q6 ~
5 h0 `) a- D: ]5 G 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. G! M1 ~- n& y: h Call PrintSummaryInfo(divSet(0))
1 J1 n4 g/ k9 h I9 v- E% j Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ( s0 l2 o, j# i0 `
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") & ~7 \2 k$ s, U" P/ H
Call PrintCollection("FORM", Request.Form(),divSet(3),"") ; Z8 l, c+ W. D. G' {5 Q
Call PrintCookiesInfo(divSet(4))
[! A+ R5 L% Y' G z6 ?) A 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)) ; m, t9 U. l4 t4 a! d0 X
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 2 }, S! B3 V1 a2 l7 u4 U
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 3 L% e2 w) o2 |* J4 l
Call PrintDatabaseInfo(divSet(8)) * A |/ p3 ^' r& o
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") $ z+ y, y" h/ ?
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
- D( a9 k8 Z6 `: U7 ]$ G- p: p Response.Write "</Table>" $ n7 N4 V \% X" S# x! x3 @1 o8 @ }' Q9 I) S
End If
2 h P% i) D% W; N; K1 i3 fEnd Sub </P>< >'Destructor
0 c5 I( `% H4 B GPrivate Sub Class_Terminate()
) W' S7 `0 `0 t A8 M Set dbg_Data = Nothing
2 {& {; v( J3 V9 A- L2 Y( u9 }& SEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
$ v$ w2 i6 l* L: KCLASS debuggingConsole 0 h! v$ n9 K3 x( V& y6 d
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 6 m; l: I ~7 C, `- O2 J
&n6 t, I# ~" y( S
bsp; 2 m" _' ? X4 G) C. N
Property Get Enabled===[bool] Gets the "enabled" value
?# d9 ^7 Z/ r; b* P# K 6 u6 M( {8 m* M8 `
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 , y: x! W. E" o- i3 i$ B D% S1 F
, m- C1 q$ v& UProperty Get Show===[string] Gets the debugging panel.
- y4 v1 o; i% m5 v8 }2 T % o) I% c+ @8 o0 B
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>< >--------------------------------------------------------------------------------
9 R* E+ Q, b* `) MPublic Methods </P>< >public sub===Print (label, output)
$ n+ m& z/ M1 b' Q Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
1 E8 j( h) W9 p Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () : C: p6 v9 E+ f8 ?) D
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
! v& C2 G+ H; `0 i9 ?$ i8 ?- tMethods Detail 5 k; a. q; s4 t$ Z/ v& H1 j+ w
+ \/ _0 E8 m6 g. I7 S# X/ A) spublic sub===Print (label, output) H# N6 Q% r2 c, P6 I0 @$ ^5 B
Parameters:
, F4 a& `& R0 K; Y& u6 l" p) \ - label [string]: Description of the variable / M7 n9 j, d7 t6 E3 ~1 ~' Y0 Q3 U
- output [variable]: The variable itself + C ]- `: F" J+ @- n0 H
Z# m$ E f% `4 F5 M7 {* l, g jpublic sub===GrabDatabaseInfo (byval oSQLDB) & [; }. y. x6 a3 z# B" K
Parameters:
; v2 @' }& |: e a$ n% x' L - oSQLDB [object]: connection-object</P> |
|