- 在线时间
- 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"))
$ X; w; \) G: O/ E6 h dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
9 E3 @; \) S% I9 _) }; S' aEnd Sub < >'*********************************************************** + e2 g# C* {" V7 m4 W+ }4 w" b
'* PrintDatabaseInfo
2 @6 Y6 J7 V6 e'***********************************************************
1 U8 d- X; \5 V, J6 q. V2 s APrivate Sub PrintDatabaseInfo(byval DivSetNo)
* _! d4 Q6 t! w1 z+ `6 q; H dim tbl
8 u5 @4 D' v/ _! h8 A5 N. n/ l tbl = MakeTable(dbg_DB_Data) 8 ~0 T4 {* ?! R/ U( ~
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) * ]4 x* T; z+ {1 F
Response.Write replace(tbl,"|", vbcrlf)
. M( q4 K s! |1 W& q9 EEnd Sub </P>< >'*********************************************************** 2 C r0 a% f) |( K4 S( ^
'* PrintCollection
, F1 U& e( x, b'***********************************************************
. m+ N' g _ i. \! Z1 O$ WPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
8 O# |9 V# H& i$ C; g5 o) W% S$ k0 Q Dim vItem, tbl, Temp
: j- }4 C8 H* t; N! Z& |) M# f For Each vItem In Collection
2 A7 k, w5 K& L) O2 Q if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 3 V$ ~8 A: a" i% J- o2 u( C
tbl = AddRow(tbl, vItem, "{object}")
) p3 `2 p" H+ w1 @ elseif isnull(Collection(vItem)) then
; R+ x P" P* Z& ?6 h( z8 ^ tbl = AddRow(tbl, vItem, "{null}")
: Z3 ~. ^$ Z. j: N6 g( t elseif isarray(Collection(vItem)) then 7 Y8 r+ d0 t" R, a
tbl = AddRow(tbl, vItem, "{array}")
& Z7 S5 I& Y9 m/ F6 z else
~% a% [7 e4 J2 K B if dbg_AllVars then " F2 G" O- B( }% z, v' b9 p
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) # h! w% `$ t" [3 V* L
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 1 R7 U9 G+ |* f/ r3 R
if Collection(vItem) <> "" then
0 G- h' E6 |" K tbl = AddRow(tbl, vItem, server.HTML+ R# G3 ~8 Q# {0 }9 L G$ Y: d1 o
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 3 u% |( h+ `9 T& W3 {5 b) k
else , L0 y( M* i* ~+ h1 \# s" m0 e- [% g
tbl = AddRow(tbl, vItem, "...") / g. J% Q4 s% d! x8 L2 Q4 s
end if 2 F3 n! H: b0 x5 v
end if + Y& R) g# K! N3 N$ y$ A8 W
end if 5 }5 E, y1 B- s# W
Next
' \7 t E% X% @5 v, W if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo + l9 U7 o8 G, }, P& F; N' d
tbl = MakeTable(tbl) 2 l5 u8 Q6 q2 U; j ^
if Collection.count <= 0 then DivSetNo =2 ( X; M, R5 b8 U' |4 g1 y4 _
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 7 Q6 e4 _1 c5 G" U* R* R
tbl = replace(tbl,"#sectname#",replace(Name," ","")) 5 m; r" x# R8 v6 ]' Z, `/ D
Response.Write replace(tbl,"|", vbcrlf) 0 B" b& }2 T. d G3 y; g
End Sub % @" ^$ z& J. K' ~. ?; o# u
3 u _" e+ M0 Y' D% y'***********************************************************
- z9 t) \1 M3 I0 H& j; n! C'* AddRow + o1 M: W9 v5 x+ s7 R
'***********************************************************
, F; t# R1 n7 r5 V! K* LPrivate Function AddRow(byval t, byval var, byval val) 8 g: K, B8 ^9 _
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
% S* B3 U, G1 N0 J" u AddRow = t
' J( A2 [: N. E5 }! z- ^/ TEnd Function </P>< >'*********************************************************** ; v* Q0 C: P* ~0 W/ b
'* MakeTable - P4 H( b- E# K
'*********************************************************** 5 c2 K; D+ p0 H$ f
Private Function MakeTable(byval tdata)
/ q7 I& R( \5 Y: b* z* h; Q tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" ; E3 ]; Q6 P: S/ Z9 W* ?8 F7 M- r
MakeTable = tdata
. p1 [* s* z) p8 X/ E# @0 h2 }) tEnd Function </P>< >'*********************************************************** . A) }# Z: A& `- a
''@SDESCRIPTION: Draws the Debug-panel : `" Z4 L3 D& j1 q
'*********************************************************** 9 g% s- x" |% B$ v
Public Sub draw()
& V6 u: ~8 l; }5 A" Q, N/ K If dbg_Enabled Then
; ^# y8 N9 l% w dbg_FinishTime = Now()
9 O6 R5 O" b) W8 p8 L - D& T# M! K/ P# u/ O7 l
Dim DivSet, x
8 K" h9 B' ?, e- o. {: l DivSet = split(dbg_Show_default,",") ( B q. L" w( x( y% C
dbg_Show = split(dbg_Show,",")
$ |# K, `% R7 y5 m1 g+ i* y, H: L
! l9 ^+ m* A( J' t1 B, p For x = 0 to ubound(dbg_Show) ( }6 U( q! \, w& Z0 X5 ?! S7 H
divSet(x) = dbg_Show(x)
' W2 ]8 w p9 A, v- {+ _! \ Next 4 S* \6 `: n& ]# L4 H! i
+ i; Q- _6 `' _" I$ 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>" 8 \+ @9 r- Q3 T- e( M8 X. X: @: X
Call PrintSummaryInfo(divSet(0))
7 h! i/ h$ z# X8 b% d p* Q Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
9 h. l" y- X, X. Y% R6 } Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ( p( p% \# ~1 V5 D. b
Call PrintCollection("FORM", Request.Form(),divSet(3),"") , k( v4 ^* q% i, `& P
Call PrintCookiesInfo(divSet(4)) 0 P* e/ R$ d! T- q6 Y
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( f5 O1 q/ d, T. R& Y Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
& z5 \) b3 d/ A8 Q B Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' G2 b- M% U6 }5 a Call PrintDatabaseInfo(divSet(8))
2 H+ t2 |1 n1 `& k5 | y, I Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 7 e1 E4 \5 R# {! L' @+ o7 s! \
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
# U( t7 Y- @* l) t x0 h& O Response.Write "</Table>"
3 a) i* H/ m3 L: E End If
( a: n d4 S0 k; tEnd Sub </P>< >'Destructor
: ]+ t: u C" C4 _/ IPrivate Sub Class_Terminate()
( m- o+ z" r) `- f Set dbg_Data = Nothing " @9 |( w% v; K/ F
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >; S0 b [ {0 G4 |! s
CLASS debuggingConsole / [5 E `7 V9 t8 q! h+ ]7 E
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 6 }- A' \6 h2 U) R6 M5 ^' w
&n0 H7 A" O- J6 @
bsp; ( B7 f3 g6 B$ P1 e
Property Get Enabled===[bool] Gets the "enabled" value , B. S b w5 `! n7 J5 e! i
( ?" p* w% 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
( e" X) ^- ?7 r7 Q $ G; X9 ~4 d. m2 E7 z! ]9 h" G
Property Get Show===[string] Gets the debugging panel.
" y* K" x1 M; X % J! S2 w: u7 T- F, k
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>< >--------------------------------------------------------------------------------
. e7 I% c; v9 \# L" l# mPublic Methods </P>< >public sub===Print (label, output)
; b. x! ?1 A6 X c Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
B2 l2 o) s& [6 a2 a# E- m9 F Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
5 n- Q1 E; @1 J. \ Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- ( j z& K! n% z9 b
Methods Detail
' u. {4 k1 u+ F' P: T
0 _- w+ V# c$ A) T$ f; a6 }0 w& L( gpublic sub===Print (label, output) - [9 W/ c# o1 D$ H. L8 m7 l
Parameters:
/ X% s. O- w" S- M0 E" I2 g - label [string]: Description of the variable ( f, p t5 g6 z6 X: E
- output [variable]: The variable itself ' R! L6 z% S, l- k2 C2 K
2 I9 @ @6 ~ Q+ K1 Rpublic sub===GrabDatabaseInfo (byval oSQLDB) o- d- g6 Y H) ^ n; [; S
Parameters: ) J) w8 W) ^! V0 C1 l9 d
- oSQLDB [object]: connection-object</P> |
|