- 在线时间
- 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"))
: J, U: N U6 {9 a* s4 x _ dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
6 B6 a) B$ d, q4 R1 y4 _End Sub < >'*********************************************************** 8 [1 i6 i6 H3 D: o
'* PrintDatabaseInfo
3 e% _# ~% F/ V# C6 L: @: B N'***********************************************************
9 y$ c6 g) i9 lPrivate Sub PrintDatabaseInfo(byval DivSetNo)
/ T J9 ?5 v% y. b' f dim tbl
' F' W- J; S* @+ s tbl = MakeTable(dbg_DB_Data) & H9 H; _, G# o1 K: ~7 K
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
# _% _7 f& P* m9 A Response.Write replace(tbl,"|", vbcrlf) . b9 g s9 O5 ~& y- C
End Sub </P>< >'*********************************************************** * y: W' Q7 B0 O. }! w
'* PrintCollection
" Q& Y, V0 v. `- P4 {. O$ I9 V6 X'*********************************************************** ; T! @1 m0 U. J5 L8 _, K
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
# ^3 d, J' N5 T6 G$ V8 J( N8 e Dim vItem, tbl, Temp
1 f; m! h; g+ | d! @: v0 P+ t For Each vItem In Collection
2 K/ _( E; B/ ?4 ^6 a7 z+ [& K if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
7 F! L3 s1 y! P9 g tbl = AddRow(tbl, vItem, "{object}") 8 |5 ^* u4 @/ {. U3 Z
elseif isnull(Collection(vItem)) then
0 o3 l! u4 f, O i; `7 ] tbl = AddRow(tbl, vItem, "{null}")
* D' r% V6 j5 p6 f* ^7 I elseif isarray(Collection(vItem)) then
1 Q: T* T+ y& F( s/ c0 c* _ tbl = AddRow(tbl, vItem, "{array}")
/ ?2 f4 Z }9 ` else 3 B2 q, y4 E) {* a: C
if dbg_AllVars then 4 A w( P+ B O- U; N8 D J+ j4 o
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) $ r: R7 f6 K5 N; i3 F9 H
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 6 H- K! D( o) v7 D$ [: K( c
if Collection(vItem) <> "" then 6 E k" ?8 Z; e4 R8 e
tbl = AddRow(tbl, vItem, server.HTML; k- P/ j' A; r' n+ v
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") # u8 B, j% x# C
else
) A' @7 K; z/ B- ?3 o' ^* a- [- r tbl = AddRow(tbl, vItem, "...")
: D* L$ }9 J8 u1 n) T$ e3 F+ K( f; C6 U end if % e( x% V1 v9 u( E/ v8 {$ q3 j8 z
end if . H f' y4 u2 F! S: g9 H
end if ; v2 x0 t6 b; z
Next
- P) n% i6 v; J+ z if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo & [1 d, ]9 a0 D0 F. f k# e5 U
tbl = MakeTable(tbl) % g; }. p8 M" M; \4 ?1 _
if Collection.count <= 0 then DivSetNo =2 P: g% [' D. ^* L
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 6 q; H6 o) `0 ] Q1 i
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
3 E9 b& Y$ O# o: E7 h4 H Response.Write replace(tbl,"|", vbcrlf) 3 v- x$ B( O" R
End Sub
6 c6 v7 x- s1 f/ p
% f- P5 k9 U2 u'***********************************************************
N4 y! r/ w( ?8 V) _'* AddRow . d* D1 k* J7 s- v+ h
'***********************************************************
( z2 g+ e C. | U, jPrivate Function AddRow(byval t, byval var, byval val) 6 Z& R' @! |5 P3 i2 R4 ?2 f
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
. M2 o( T! }& g+ A( G AddRow = t : ~. ~) E' L/ z b
End Function </P>< >'***********************************************************
6 d" d7 q0 ^7 G. I'* MakeTable $ j- S, P" V- ?" f& r
'*********************************************************** 9 ~% S9 R1 O+ P4 J
Private Function MakeTable(byval tdata)
. G9 [9 H" U n5 a tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" / B6 \2 @+ @2 W' `, |/ \
MakeTable = tdata
3 ]8 f' Y3 X3 }3 r4 s- ?8 F6 S+ _- MEnd Function </P>< >'***********************************************************
( w+ I* U5 G+ D5 n6 p''@SDESCRIPTION: Draws the Debug-panel 4 h$ Z- U8 w9 u) h, f3 Q2 H
'***********************************************************
3 Q. m: m( G0 f( n* J2 v2 Y3 m/ jPublic Sub draw()
, z; z6 `- q9 b3 L1 s If dbg_Enabled Then % C' ]6 M* t9 Q# V$ C
dbg_FinishTime = Now()
5 ^' u: p9 {, u' T; |8 V: w
' b# Z. {3 w# X( A9 F1 {: N$ W Dim DivSet, x 9 T. J6 A1 R4 m0 v4 c' y
DivSet = split(dbg_Show_default,",") 3 z0 z7 S; O9 o5 j4 G
dbg_Show = split(dbg_Show,",")
$ i% A$ o6 g8 J3 s( Q/ p, X : w( N3 i" O; X9 D$ \% O6 c- y
For x = 0 to ubound(dbg_Show) ! x# ~1 Q" b1 }+ N
divSet(x) = dbg_Show(x)
: f4 k' T& }, d6 g# j; n, b w Next , {% B/ F/ X6 v5 x3 C1 E. }
0 g2 e/ ^% b+ ^0 `+ I% V) J 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>"
9 V0 J! y) U- B, W Call PrintSummaryInfo(divSet(0)) & q' E# ^# P3 Z: ?$ U8 @( n
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") : m* U% A$ ?4 G5 F$ Z2 e
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") * D4 O5 z" |. [3 r- ?) k$ F* k
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
" B/ T2 w R! q4 i/ N- f! L Call PrintCookiesInfo(divSet(4))
! Z# n6 F, j$ i2 G 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)) . ~6 g. i4 l+ f' k
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
" J6 H7 w M0 o Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ; v; S4 F2 R2 Z. ]
Call PrintDatabaseInfo(divSet(8)) U; N; S8 o8 [# }4 Z
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
9 g8 r4 l6 f$ d8 e! [. p Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
4 H2 p% ^+ z6 F" n Response.Write "</Table>" ! r4 t: [! _- a: P7 G) D
End If
" G7 u& h% p h. D& R& P2 SEnd Sub </P>< >'Destructor
; m. E8 i" g6 l4 ~% V0 HPrivate Sub Class_Terminate()
$ m; F8 m0 f+ J) h: K% R Set dbg_Data = Nothing / X9 l. c; z! W+ R# |. L$ ]3 C* r
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >- O8 ]: ~) I! y9 u& a! p+ P
CLASS debuggingConsole ' X3 [8 i2 d7 o8 {
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
+ u [9 S Z, D. [&n
' V8 D. t. W3 F! \bsp; 4 y5 x: \8 X. @$ g+ C- O# ]
Property Get Enabled===[bool] Gets the "enabled" value 8 j: K, u% H) O- O' B
7 x; X2 L6 O: h. c0 _- }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 z' x2 B1 w: Z# Y . x9 X: s3 \* |
Property Get Show===[string] Gets the debugging panel. ' |" E! ~: g3 i% D4 Y6 H1 I* L
: Q) I4 ] y4 t6 Q' `
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>< >-------------------------------------------------------------------------------- , @+ j4 Q( s$ A6 h
Public Methods </P>< >public sub===Print (label, output)
0 f/ E' ?/ _9 W2 G8 I& ?7 p( l7 Q Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
; S, F7 k: F6 i$ q+ x Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
* [# L* c' H# p+ H+ ~+ y Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
# { J! ]: H! [& m" BMethods Detail * F; {" k% B O O
( ?' B0 g: C% A
public sub===Print (label, output)
+ C3 Y) V; R. x+ G3 HParameters:
$ k# S4 M8 _( b/ |, k - label [string]: Description of the variable
% m0 W% O7 K" o) ^, ~' E' T - output [variable]: The variable itself , f# g. \& e- z) _
% j. ^+ L! g- e6 U
public sub===GrabDatabaseInfo (byval oSQLDB) ) u7 d3 U# k1 e8 c; T: F1 N
Parameters:
+ ~% W& N3 m3 f# H' O% G R+ U - oSQLDB [object]: connection-object</P> |
|