- 在线时间
- 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")) 9 p+ [0 V" S* Y2 v2 x' Q$ d& C
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) , ]' ^3 X) ^6 ?/ w) N V0 ?( G Y
End Sub < >'***********************************************************
1 F# l- Z7 Z+ h8 ~'* PrintDatabaseInfo
! M; c# ~2 N5 v9 W! K'***********************************************************
6 B( H" ~9 ~; l, K. a3 W# WPrivate Sub PrintDatabaseInfo(byval DivSetNo)
- [- y) o& K6 u. P* z3 O7 a dim tbl + I4 ]5 q: t2 E: o/ i- `% `
tbl = MakeTable(dbg_DB_Data)
* i8 Y" r& `0 p tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 2 R, r0 v# D& c& ?3 r; Y, J
Response.Write replace(tbl,"|", vbcrlf)
% S# n6 L& q% B- \End Sub </P>< >'***********************************************************
& e" U, Z5 C b4 X! @" F5 B4 b9 b/ X'* PrintCollection
. x G( g2 ]7 j5 A0 F* q2 `" y'***********************************************************
]5 b+ N& h- J5 {3 O- b5 GPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
( C K9 s. n {: p4 c; n Dim vItem, tbl, Temp 8 D, z/ p3 c8 B4 L$ v# P, o/ T
For Each vItem In Collection
9 y& ^) i& h) k& x) B+ G0 i/ H9 K2 u if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
( l4 [5 D9 s: k% U/ A tbl = AddRow(tbl, vItem, "{object}") 0 d, ?- i( ?5 a7 y/ _) h
elseif isnull(Collection(vItem)) then ! t: ^+ d( i8 s' \* }( z
tbl = AddRow(tbl, vItem, "{null}") ( ~/ r% l3 [1 l: s% }
elseif isarray(Collection(vItem)) then
L$ t/ L2 W j8 y tbl = AddRow(tbl, vItem, "{array}")
$ f$ J3 j" a9 Y. j0 p else
, T& [/ l" m$ z$ F) z7 ` if dbg_AllVars then & ?8 s! l9 }* @4 s
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) / v' h9 v v5 ]+ j5 u( j
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 8 ?, p1 L) K2 k$ U
if Collection(vItem) <> "" then . ?4 J2 S& _$ C! P
tbl = AddRow(tbl, vItem, server.HTML/ F, a) z( c* [) H$ t' M# r
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
1 @' g" |: I8 i) D' E4 v else
, V9 o1 L- p; ~" W. s tbl = AddRow(tbl, vItem, "...") 8 f; m: G/ i) G9 \ F8 S
end if ' R v1 h u% o$ ], g+ c
end if 2 I: D; N( G/ M1 @* }% b! a
end if $ {# y1 I; @5 d* V
Next $ G" N$ M; G ~* R; }: f" h
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 6 R: b$ v4 g' G( }' U
tbl = MakeTable(tbl)
`6 f# r; D' c" n6 h if Collection.count <= 0 then DivSetNo =2 : h+ L( i" ?8 ~# b+ D
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 1 P% e9 ^2 k! Q1 @' c
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
% p. g; `/ V+ I+ c Response.Write replace(tbl,"|", vbcrlf)
9 I1 P5 L9 h9 G! i6 @8 d6 p8 rEnd Sub
8 w7 c! U% Q. ~ 7 U$ Z3 j# t8 G, `8 F5 S
'***********************************************************
3 q, x$ ?8 o, f% o'* AddRow 5 Q8 {" C' {. w
'*********************************************************** % O1 r- b2 _ ~2 h: Z' I
Private Function AddRow(byval t, byval var, byval val) # ^+ v* U2 Z d' F. {
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" ! [" d+ s+ B2 N7 _$ \
AddRow = t 4 b( s( B& x; e% q
End Function </P>< >'*********************************************************** ( |! A* P9 `7 t9 I+ Q
'* MakeTable 8 W, w, j: ]/ V' d$ ^, h- K) E
'*********************************************************** 0 R7 T0 x' t4 {$ w( H: H$ g" Q
Private Function MakeTable(byval tdata) - h% h# f3 J0 e' A4 l; ?2 n' Y
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
* l5 ` J( h9 V- J: l; ? MakeTable = tdata
4 \& m4 E7 j6 z; R9 R) |End Function </P>< >'***********************************************************
0 \7 Y5 `. Z; [3 v% L''@SDESCRIPTION: Draws the Debug-panel
! E- _$ H. R3 D ]* A- X. X'*********************************************************** ; P$ L0 N/ g4 Q3 ~
Public Sub draw()
. ~ J5 [) D) S# F6 v/ s If dbg_Enabled Then
( F. d3 S) f, k4 k dbg_FinishTime = Now()
; s) M$ a1 k m$ p9 ^ " X. B; ^+ W# T; }8 X
Dim DivSet, x
" o7 k. ]6 x% b' Z: v" M DivSet = split(dbg_Show_default,",") ; m9 b: O9 N& u4 E$ Q- H
dbg_Show = split(dbg_Show,",") 0 Q3 W% L& y6 M: ]0 S
, B0 z/ y6 q$ h& M5 B1 |9 j4 O8 P# O! ]
For x = 0 to ubound(dbg_Show) 9 t$ }& d! [9 }8 M- y9 ^8 z. _& S% W
divSet(x) = dbg_Show(x)
% L- @/ k7 i) b- V8 s" f% V Next 5 {* @' P, o# w* p( j4 k% [' r5 _6 v6 t
# c; }2 k3 j7 c' i% s7 V6 S
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>"
" G, f. A/ [1 K Call PrintSummaryInfo(divSet(0))
$ `! L8 G! E# |$ @9 R; C Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") # E' X" H E) N( _; R
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 1 i* F# P0 v# z$ d( k
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
$ |2 H, f& j% e S8 ~ Call PrintCookiesInfo(divSet(4)) + r* L( R4 B2 d( B- A
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))
" Y i& D9 b& ?. ]. R! Z Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") . P7 n- a) u. @( Y# Q3 r
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) % w% g/ b) ^; T% m2 [$ ]
Call PrintDatabaseInfo(divSet(8))
9 Q V: p) U8 Q8 I% A9 y& u Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
- @; k3 E$ R! ` N; p9 @ Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 2 H1 _( `' n2 p V
Response.Write "</Table>"
6 w# X0 C( D9 B) f7 _ End If ! ~) O; S V9 e( [$ U% N9 [2 {. g
End Sub </P>< >'Destructor ) Q$ J& J C( c$ G$ y e: m
Private Sub Class_Terminate() / y3 e. W7 E4 W) U5 |0 T3 Z+ `
Set dbg_Data = Nothing 4 p! @; |" V8 u3 O+ S2 l
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
7 i9 m2 }" r1 S- G2 lCLASS debuggingConsole
; T4 {$ r7 M, Q: s! |: P9 tVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
' L: u% i* k' E( i3 Z&n. F. _1 V+ F% g4 l, V- z
bsp; 0 u, w# p" y4 e \8 {7 g; t/ q0 t
Property Get Enabled===[bool] Gets the "enabled" value 2 o Q9 {9 L3 L
9 ^2 A: _) L. I p8 y' _
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
; ^, S1 z. D7 } {2 ], G0 t( L8 u
Property Get Show===[string] Gets the debugging panel.
5 f6 C7 D1 h/ ^- v3 w. l7 g" L. z
3 t! ~7 r @9 M( [* f+ y1 N' KProperty 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>< >--------------------------------------------------------------------------------
* q& N$ J3 G9 F" _Public Methods </P>< >public sub===Print (label, output) % i1 Q; D- e8 _$ s' C
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) ' ]$ z* Z4 P1 X, Q! e
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
( s& ]: J/ h& M z( z J Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
& T. {2 C+ G5 H4 T( ]9 aMethods Detail
; K% y3 f' c! \' [5 {' ]2 b2 H, l 1 e! j, i( J% V. u
public sub===Print (label, output)
5 R; x' c S" C$ `- b" ^ u8 PParameters:
6 ?7 j* ?# J8 I' m1 M( |' E - label [string]: Description of the variable + a# F" E( P, q
- output [variable]: The variable itself ( b6 V; e% _& U4 A
! C% }& m9 _% [; a }
public sub===GrabDatabaseInfo (byval oSQLDB)
b$ A# }( d! \1 J! U" rParameters: ) ]: \' o* G/ j) r8 b( l
- oSQLDB [object]: connection-object</P> |
|