- 在线时间
- 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"))
& C4 B+ Y& L5 A B2 T7 n& | Q dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
; [- t6 ^5 y; N3 GEnd Sub < >'*********************************************************** ) b2 M5 J* z4 r0 v
'* PrintDatabaseInfo
- D" b/ h4 S8 x) t# ]7 \- V'***********************************************************
# q) l6 w t+ [- g# C( L; G. {Private Sub PrintDatabaseInfo(byval DivSetNo)
+ r4 ]6 ~, V! D" Q7 `: D dim tbl 4 y0 [; d+ h6 a1 n8 W% x9 x
tbl = MakeTable(dbg_DB_Data)
0 H8 L: W; j F& W8 X4 v/ N tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
4 M' N+ O$ D' P Response.Write replace(tbl,"|", vbcrlf) * W( H* A1 m0 R) k0 |6 G& z
End Sub </P>< >'*********************************************************** 3 b9 [. S* U0 z$ ^: g$ e4 b
'* PrintCollection
3 o ^! ]) C- K'*********************************************************** & L5 d1 X' f5 h% Y6 \: F! Q
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
W) I; d) o/ P" y' M Dim vItem, tbl, Temp
& d* m6 [+ w+ l& W9 }2 A For Each vItem In Collection
3 H" \6 [9 B+ f2 Y. X if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
! {2 O, _; n& H) p6 B/ E tbl = AddRow(tbl, vItem, "{object}") 0 |: Y H7 w, D8 s$ a% n+ {3 _
elseif isnull(Collection(vItem)) then
( Y: h5 t0 B( J4 s" f, {) n tbl = AddRow(tbl, vItem, "{null}")
- w8 x# c, r( B# d* J q elseif isarray(Collection(vItem)) then 0 f+ ~9 I6 y3 {+ B0 a c2 v9 V
tbl = AddRow(tbl, vItem, "{array}") 6 K3 ]2 z+ V9 s, d7 i) e: |
else / ~. D% N& Z2 m$ V8 ]
if dbg_AllVars then 8 x& E4 ]( E6 N1 F* U, }1 ^
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
! N* R5 e) F* F elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
' W- v2 r# M! q" ^ if Collection(vItem) <> "" then
* l E2 O. w' ^' ^: z+ t( o tbl = AddRow(tbl, vItem, server.HTML
) M0 [5 P% r+ i: N3 gEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") ' ]9 H6 H4 r, i$ F
else 4 B: C1 b- {& B$ u
tbl = AddRow(tbl, vItem, "...") 2 l' @( L1 e- n! S& V
end if * ]6 a$ `! f1 I4 p- ]% s
end if |0 e5 v D& h/ R" C( S7 K
end if
# s) J6 Z; L( u Next 1 ^2 a% A: O( a, Z
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
1 M2 E4 T3 P% a. U" D tbl = MakeTable(tbl) # M# Y4 g$ E) n
if Collection.count <= 0 then DivSetNo =2 4 F, k9 ]5 d0 h$ H" w
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
( v/ z1 L% J+ v: v3 r tbl = replace(tbl,"#sectname#",replace(Name," ","")) 5 j, ~2 [& _2 @7 `. e8 Y) m+ S
Response.Write replace(tbl,"|", vbcrlf) " o I N L8 P- g C* v h
End Sub
, ~ F& k* P7 @- C1 ]8 R- _* p
: Y1 v1 F2 q3 v+ v/ Y% p'***********************************************************
' P" C3 m4 n% L2 d6 y) ~'* AddRow 6 _0 w/ T$ ?7 W, l
'***********************************************************
" {# z& z$ [$ |6 q$ `# N! Z) @Private Function AddRow(byval t, byval var, byval val) + d& T) S4 |# \. u
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 0 ]* ]) ` p# }$ \) X
AddRow = t % H! U* Y5 m# W- K8 K6 X/ s
End Function </P>< >'*********************************************************** 8 A# m1 G* Q# d" ^: G0 I6 J
'* MakeTable
) O7 H3 B# R, m/ a* h' Q7 K1 M'*********************************************************** 1 F( X6 e7 n5 y# H& ?
Private Function MakeTable(byval tdata)
' s) p% @6 I4 _! O tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
1 G3 Y2 U$ B- U% K& V MakeTable = tdata
6 ^' F/ p8 l9 I2 T8 ^1 C) VEnd Function </P>< >'*********************************************************** * k. R1 v, _1 u1 G1 n
''@SDESCRIPTION: Draws the Debug-panel
u4 J, [! H4 @: s- ~7 ~$ G'***********************************************************
' z* @1 C3 U) SPublic Sub draw() , D) W% m8 @1 U
If dbg_Enabled Then : e# z8 B0 T( z" U
dbg_FinishTime = Now()
( X, X! k. o: x # y( Q/ @. i0 r, P2 |8 z" R
Dim DivSet, x , { ]/ `+ q% t& W2 f
DivSet = split(dbg_Show_default,",")
/ H. g( k+ A/ {7 d& m4 v$ a dbg_Show = split(dbg_Show,",")
1 Z- g: E1 ?/ C2 y' ^. z % a: q% K* k# {0 |" k, Y
For x = 0 to ubound(dbg_Show) ( d! y1 H$ _6 _8 q- |
divSet(x) = dbg_Show(x)
2 i2 r' d+ }! h( A9 p5 n Next
6 b7 M7 c: ~; U. Z( Z+ D7 F/ w! o
+ \: [6 M/ {: ^ Z 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>" 0 y' `. }. w9 O j9 G- ^
Call PrintSummaryInfo(divSet(0))
! X& ^; m% G9 Y' d1 u Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
?9 y }6 }& X0 Z9 m Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") : f) M+ B6 j. x0 {. a8 E4 ^
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
- m, F, C! r- h& W" C- z Call PrintCookiesInfo(divSet(4))
: t8 F+ z% {2 V4 Z/ r& d 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)) 8 K+ Q$ N/ N% |1 m
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ; o% @- p. b: {# j( l
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
% c) m' p, _% \$ ~- x4 D Call PrintDatabaseInfo(divSet(8))
! K% a2 j% d6 \- B Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") + o5 W7 R- P$ ^( R6 e- O
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
( j E' z" L" X3 d7 ~5 N4 o Response.Write "</Table>" 5 S* A4 |2 ^0 @$ e
End If $ z! N J5 o, c* O
End Sub </P>< >'Destructor * s( G1 g8 B/ k
Private Sub Class_Terminate() # n5 ?- a2 y2 L8 L& i( _3 X
Set dbg_Data = Nothing % n+ ~5 Z5 Y( c4 d/ e
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >0 W3 s7 U3 A: ?. Y |
CLASS debuggingConsole ! g7 l9 N1 q% G1 A; G! f& j
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 8 I( }" B, n+ m4 T6 D. Z
&n: G2 |; x' p6 G! v
bsp; 5 V7 ^/ [1 a7 o5 o/ L# d
Property Get Enabled===[bool] Gets the "enabled" value
( }4 E0 T& K. M/ G
( z( O X8 W3 j- P7 {% G8 BProperty 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 8 k% w4 k- Z( K; L) ]& m
4 s+ r: J% G w6 N5 W
Property Get Show===[string] Gets the debugging panel.
4 N0 Z+ h0 _4 w$ ?4 ^ 0 b/ k6 o( x5 r$ y- i! q% O# K+ m& b; m
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 R* M3 p+ o- c% |: |3 BPublic Methods </P>< >public sub===Print (label, output)
' t& |/ o3 C! h- o- @ Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
2 n; _% Z- ] |* ^5 w3 }, E m Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () # h" D! w9 K' _
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 8 K2 b% \( E: S$ [6 {% a |$ x' m
Methods Detail
2 k$ O# \% j6 I4 Y7 F* \ - {) X& t: `) `1 Q9 \7 l: @
public sub===Print (label, output)
. B0 J5 C: H8 q! b- vParameters: 0 g7 s" u+ E, \( f
- label [string]: Description of the variable
* |" u! w- o1 W1 Y, Z1 ^# v - output [variable]: The variable itself
+ u8 u; n8 U5 a/ t: H
! b$ R: U# m2 ~, |: hpublic sub===GrabDatabaseInfo (byval oSQLDB)
1 `# I6 S* x7 }$ J) O9 `Parameters:
6 s2 ^. m3 V! ~( w# ^- t |, z M - oSQLDB [object]: connection-object</P> |
|