- 在线时间
- 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")) - s0 |5 ], M' @3 {- U, ^
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
/ g: T- ]- N$ ?) R/ s6 L& M4 uEnd Sub < >'*********************************************************** % t/ I6 C0 z3 B/ G" @$ z
'* PrintDatabaseInfo ) K( d! Z; j" k! A9 U
'***********************************************************
I8 t8 B; T$ A4 B) V$ _Private Sub PrintDatabaseInfo(byval DivSetNo)
5 i8 }/ d! D: V( i9 u6 n% \( ~ dim tbl
0 k6 ?, K+ _1 C: d tbl = MakeTable(dbg_DB_Data)
% K$ t: ?4 W& C% X, T) P' M N tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
$ l: d6 U7 D' s3 e Response.Write replace(tbl,"|", vbcrlf) ' X9 t" c2 M$ w; c. k
End Sub </P>< >'***********************************************************
$ q. q0 u! }+ ]# ~5 S'* PrintCollection + e' Z% J* x/ O& {, P# s# K
'*********************************************************** : Y% e: S/ A2 O; p
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
8 e. r) O4 m5 ^) d% ]2 [ Dim vItem, tbl, Temp
( M. B. W, |( I For Each vItem In Collection
! l0 }0 K. s( g% w+ ~ if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ( | h8 m& a, C' @# \' @0 X0 M* O
tbl = AddRow(tbl, vItem, "{object}") , F3 q8 }. O5 E. @
elseif isnull(Collection(vItem)) then
* H w3 l" ]. N7 x% Z6 @ tbl = AddRow(tbl, vItem, "{null}")
7 p+ p: ]' G! f% ~3 X elseif isarray(Collection(vItem)) then 1 T: [5 K5 Y7 M0 z, f
tbl = AddRow(tbl, vItem, "{array}")
# f6 R) s! D5 R7 q0 Z) e( x- ^ else
. w- M! T5 ?: W3 P% k g4 y if dbg_AllVars then
, c, g3 x& H% ^& z tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
! E7 M5 E* q4 Z( l elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
5 ^$ ?5 l) ^: G2 _- r if Collection(vItem) <> "" then $ s9 A6 n5 u* {7 _; N
tbl = AddRow(tbl, vItem, server.HTML) C4 Y6 K4 q7 k3 y
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") ( O/ Q9 e* S- a9 j, |( [& w8 V) x
else / J1 P4 L' ~1 P+ f
tbl = AddRow(tbl, vItem, "...") 8 f5 u0 X9 t3 P3 a% r+ d5 Q0 ^
end if
4 a8 I G0 ?# i: G& {0 Z end if ) E9 F3 q% ~' n, E* I
end if
# B. O! l" B* d, E3 Q* X Next
# Z2 K. |3 }/ r/ r* | if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 2 N3 l7 ^. ~( s6 ~
tbl = MakeTable(tbl) 1 y, L% A. {2 G9 i0 l9 S1 S
if Collection.count <= 0 then DivSetNo =2 4 s1 R. z/ Q: C7 X
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
/ k! B' C) N$ L G) I tbl = replace(tbl,"#sectname#",replace(Name," ",""))
6 g# s% a0 N! y3 j" S7 } Response.Write replace(tbl,"|", vbcrlf)
: N# q: a! P; q6 lEnd Sub
$ T6 O: X. Y! W% P' ^# c ! f6 U, S7 ]$ p( J$ T& n; n% I$ ~
'*********************************************************** ) T) [6 {4 O- ~% f4 u
'* AddRow
5 }9 _( U. U) `/ R0 k'*********************************************************** % S) t- B6 `. e
Private Function AddRow(byval t, byval var, byval val)
5 v$ K0 ~9 y; U* R0 [ t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
* ^$ K9 Z$ t9 R( ? AddRow = t 6 h/ j/ Q; r! A" {6 U
End Function </P>< >'*********************************************************** " T2 y9 W6 h8 b1 F: m0 |
'* MakeTable ' t+ V( N0 }" z6 U8 m
'*********************************************************** ' y; V) _& m' ?, j. d0 q% p, }
Private Function MakeTable(byval tdata) " O7 L. h# R) j( h0 q5 F
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
3 @3 X! J3 l k9 l! l' [5 L8 f( ? MakeTable = tdata 9 e, [ A3 ]' F1 J- @
End Function </P>< >'***********************************************************
; ]& e1 R; L8 n3 _# A( A, n''@SDESCRIPTION: Draws the Debug-panel ( B0 f+ s& z& \
'*********************************************************** ) [; q0 j, T' L. d! H' E
Public Sub draw()
& v, }" {; |& D9 [/ c- m! q If dbg_Enabled Then 1 g3 ?$ B% Y( O r. g
dbg_FinishTime = Now()
7 V5 B3 p5 [0 [; |, w J 0 G3 s/ {- V* B2 L; B$ \
Dim DivSet, x
+ w G% l8 d; [( G H- A DivSet = split(dbg_Show_default,",")
" Y0 b8 U {/ A3 @3 F& G dbg_Show = split(dbg_Show,",")
" z# v7 o9 s4 y, x) `, B; d7 { 2 j0 d3 j6 Y/ r. E1 X) r) o
For x = 0 to ubound(dbg_Show) 0 @- f! y& o! y# y2 M% ^9 }6 {
divSet(x) = dbg_Show(x) - b6 ~7 @+ q2 {7 E3 q9 B4 l2 E
Next D3 M& V. l2 ?! w
% }9 h8 l' ]- i 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>" . f' @. v7 y6 q* {% a
Call PrintSummaryInfo(divSet(0)) 1 d/ r( P+ N* q, R
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 3 }8 `' \( C, A* _5 q
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 1 @1 Z" r! \9 H, o1 O2 v
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
; t* \( I: r! u S; C Call PrintCookiesInfo(divSet(4))
0 ~- ^5 n% z" b1 f5 w/ 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))
* ]2 m- W; ? y Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ( c& u! p0 o: f" T' r1 e; J, k
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) . ^9 ` h) u' W/ d
Call PrintDatabaseInfo(divSet(8)) " r( I7 h R) A2 T$ ]- c: Z" D
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
" g+ j; r9 h1 z5 o8 w) i& J Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") b* f1 I8 V% T2 x% `
Response.Write "</Table>"
+ c& B( c ?' L: R5 O$ k( m End If ) ~2 H q' `) G0 ]% j/ Q& Q
End Sub </P>< >'Destructor 5 U7 M, |* m8 X/ c+ f
Private Sub Class_Terminate()
0 Q4 b! ~) k% Z4 G7 S Set dbg_Data = Nothing
* f8 V+ y( N; Y# \" v& i, m/ _) OEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
4 k, N9 a; j* P" h, E- z& H: v& H JCLASS debuggingConsole
9 M7 C$ d. M9 L0 ^( V; d' U4 p) D1 BVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
' d- R+ g6 W+ O5 O' q- d&n
! I7 ]# m# N# a- w y* Cbsp; & j. k) q* _9 Q& A2 g& a
Property Get Enabled===[bool] Gets the "enabled" value
% |* Z$ [/ q# `
- ^' h; G) N; P( o$ I2 U: e1 wProperty 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 6 F% `" o# s: q9 Y4 F
' Z5 c M1 M; V: I% U% I
Property Get Show===[string] Gets the debugging panel. - }6 O8 d3 y; U9 Y: p8 X
# Q' L1 G- |5 ~, l/ rProperty 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>< >-------------------------------------------------------------------------------- + ]0 d3 q6 Z- @/ }6 o
Public Methods </P>< >public sub===Print (label, output)
/ B; [( d& A) ^+ ] Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
6 N1 L, M9 \- R* a! a3 a Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () , P; {( q* a4 f0 B. u
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- - `+ H( Q6 {+ o* s* C! M
Methods Detail % O, B* U+ S% W: P& I
: o' n( a1 M( W6 @4 p
public sub===Print (label, output) * d) }# B+ z/ C& G' U; s
Parameters:
5 j; s9 a+ r9 [7 v' b - label [string]: Description of the variable
' l( B) c/ g, K4 B: g1 w - output [variable]: The variable itself
2 |$ p- U! \; ^3 n : x- H1 L% T1 w$ G! Z$ L
public sub===GrabDatabaseInfo (byval oSQLDB) # N# G: n0 e- g% p0 |6 s2 Z& \
Parameters:
' J, k4 U1 v) D$ o; c( M - oSQLDB [object]: connection-object</P> |
|