- 在线时间
- 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"))
" J2 j- t! x% `3 N" k8 L/ Q! \ dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) ! h6 c. E1 a+ {' \' g& J
End Sub < >'***********************************************************
2 @6 Z1 B2 c3 j4 c! o'* PrintDatabaseInfo ! E }, i; R4 o1 e: r) l( F4 E8 R
'*********************************************************** 1 G4 t+ f% |7 k# L
Private Sub PrintDatabaseInfo(byval DivSetNo)
* Y! j! d0 }8 ]. C" f dim tbl
( d2 N( P8 u) ~7 o% h+ g) E0 K tbl = MakeTable(dbg_DB_Data) ) U% Z9 z3 {' R" m2 ]9 y3 r' g" `
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 1 t3 @1 B% q t9 G1 v
Response.Write replace(tbl,"|", vbcrlf) 9 q" M: i' O, j; }- g
End Sub </P>< >'*********************************************************** ! m" j+ A0 d9 S" B6 i
'* PrintCollection : X) c: F% s5 k N# P3 N8 W4 g; f
'*********************************************************** . h! [1 K. Z' V2 J
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 7 c2 ?$ r V3 {5 U% z5 a4 y4 F. U
Dim vItem, tbl, Temp 1 T$ i7 O- Z) M9 q: e
For Each vItem In Collection 4 D+ ?$ Y) l$ s" T: q
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then , _: ?/ L7 g/ n% L: W4 [$ C
tbl = AddRow(tbl, vItem, "{object}") + u4 K2 m$ T# y9 w8 n Y8 o
elseif isnull(Collection(vItem)) then
6 k, _' J$ {' A" | tbl = AddRow(tbl, vItem, "{null}") " M, B1 A H! s) P# z/ u
elseif isarray(Collection(vItem)) then
% L- X% L4 d- a+ I tbl = AddRow(tbl, vItem, "{array}")
" A/ k2 l3 `: w1 H else $ Y# R9 W" N0 A4 }$ E: i3 V9 e
if dbg_AllVars then & Q, w. h. w. X& T, M
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
8 I: H3 @' q& @# K) J elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
0 w% K0 e8 K7 R9 p! N1 H; u* A if Collection(vItem) <> "" then
' M0 D* G/ }; }' @9 b tbl = AddRow(tbl, vItem, server.HTML5 G/ X4 g& \ r* @' |
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
; S2 W( h) ?8 e3 y6 p, V else
' ^9 R5 i5 i% {1 t. W& c4 c9 r: O tbl = AddRow(tbl, vItem, "...")
# j5 ~5 ?" D8 B& u" ]" U8 y! T3 q end if
1 g6 t+ z5 ?! p( c- a6 H/ n5 p% \2 H end if ! y, J; S* u3 z4 f) x7 U
end if
- w/ i8 E3 z8 c5 ~% S u/ F Next & Q1 B; M7 }# g
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo ) x. P2 x5 ~& X" P4 a" c0 L
tbl = MakeTable(tbl) 9 f; c% ~ o& i9 \: q+ U8 e! G( h
if Collection.count <= 0 then DivSetNo =2 , V( P9 F# d9 C4 L* W
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
5 a8 u8 ^. K9 ` tbl = replace(tbl,"#sectname#",replace(Name," ",""))
* b/ N1 H: O( [! | Response.Write replace(tbl,"|", vbcrlf)
5 l3 n& F5 c- j) m' y) ZEnd Sub
0 Z: ]7 d" i0 e" e/ q1 N & S9 r- o! g/ G
'***********************************************************
9 T: v( K7 T q2 x; X'* AddRow
4 D- U3 }* Y6 L+ f4 [% x7 x'*********************************************************** 6 Q* \7 ^+ B/ h; n; Q% \
Private Function AddRow(byval t, byval var, byval val) / y0 U6 f5 }) ]+ n$ X
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
9 @8 B; i; G% o" u2 X( x AddRow = t
H% ]: q& W% }End Function </P>< >'***********************************************************
/ d0 `. S j8 y) p1 K; H7 s# r'* MakeTable 8 u; \" v# W# J7 G1 V! b, h3 |) j
'*********************************************************** 1 K& Q4 p1 k4 p7 l' X% Q" r
Private Function MakeTable(byval tdata) , P/ W* i v' J: F/ X
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 5 |# l# v& X* Z% O
MakeTable = tdata 1 h0 }+ H& S6 f$ w
End Function </P>< >'*********************************************************** , m' Q3 S8 P$ R9 b9 r: F" d) h
''@SDESCRIPTION: Draws the Debug-panel 9 B' |8 h. G" X$ w
'***********************************************************
- |% |3 _& G8 ?8 m& o) {+ JPublic Sub draw()
8 i: X; |# Q$ F$ H If dbg_Enabled Then
' B) m: d3 O- l dbg_FinishTime = Now()
) z, x3 ]- G. R2 j9 ?# b4 i 5 ~5 }3 h. W- i2 D3 n0 U) w
Dim DivSet, x
; _; L1 V! I9 k' m* F3 H( O DivSet = split(dbg_Show_default,",")
0 w# [/ Z9 ?: u) J! U7 G dbg_Show = split(dbg_Show,",") $ P7 U/ b8 D# Y- `9 ^
0 i- X7 G9 T! f$ i8 i For x = 0 to ubound(dbg_Show)
; p7 i6 z6 ]7 d& F; m# \# M divSet(x) = dbg_Show(x)
/ [9 Y( f8 P" K% l4 V Next ' q, B" y0 R7 S* S- L
4 }4 ]) Z- M) U 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$ W- R! {6 {8 u: V Call PrintSummaryInfo(divSet(0)) 1 C3 B& j. J0 O4 ~3 E$ R* c1 ]
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
5 ^ {. ]# C" e+ g i2 B3 a Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
- r6 W1 {1 K* Q Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 t3 X! A2 r! N, ]0 [! X, ^ Call PrintCookiesInfo(divSet(4)) 5 j2 ?: D2 J. R9 r( f. ]) }% R
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))
/ x% }, n5 \ X0 p5 k Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
1 ^" @, `3 N7 |' C Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) / u0 j7 w* W! ?% P( t9 Z# G: G
Call PrintDatabaseInfo(divSet(8)) : Z# |/ f- R, p( s/ K
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 3 O: x' z; d# J8 p; O! H
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") * e' M# d+ ]1 v: H' @
Response.Write "</Table>" 8 Q& D5 a/ Z5 ?- C7 z+ h8 \% |. y+ k" t
End If 4 S; t4 C& _- E z1 ]# E% r- I7 u' u- H
End Sub </P>< >'Destructor
2 ]) M6 _- A* O8 {Private Sub Class_Terminate() ' A7 x; K& H( b6 ^
Set dbg_Data = Nothing 7 T% g% G( E, K9 ^' u
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
) x* J/ C+ Z$ Z- V" @9 j1 H1 gCLASS debuggingConsole
. z: m0 {: u) v. m3 UVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 2 P$ o' G" G- O2 `3 _' q& X
&n
( {0 X! Z7 M1 H2 ^* Tbsp;
2 o7 g) Q3 j* w& H7 k4 Z! w* RProperty Get Enabled===[bool] Gets the "enabled" value 4 H9 {; l C: B( B4 n4 e1 v* k8 e
; c5 c3 Z6 v; {' I( H* k& s
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 1 A ~, i$ C7 {$ @
2 B4 f- N: A2 l9 S0 E
Property Get Show===[string] Gets the debugging panel.
7 u, Z6 x- w9 I7 K& u; D7 Z2 u ) Q% t8 |3 W; O5 _2 v- T# k: 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>< >--------------------------------------------------------------------------------
- A, v! I* a( U' j- O+ `Public Methods </P>< >public sub===Print (label, output) ) a. q& G* x5 x! Y
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 7 i8 v0 Z8 W ]3 }3 _6 z
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
' o9 \" X2 y% ~7 M4 C. K/ b Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
4 R7 O. E/ ] QMethods Detail , F0 t' k& N* \! z! b* W
& _- F9 L3 p; ]7 _public sub===Print (label, output) 4 z: a2 b; U9 q2 R6 N, e
Parameters: ; n5 O7 \4 o p( j
- label [string]: Description of the variable
. O, [! ?1 y) A8 S# T+ ^: R { - output [variable]: The variable itself - b' p8 W2 q% `. d' V
- J7 g% S5 x w; v! k, S. l$ Wpublic sub===GrabDatabaseInfo (byval oSQLDB)
9 [( z4 C% f& r hParameters:
g. Z4 O7 P- a, Q - oSQLDB [object]: connection-object</P> |
|