- 在线时间
- 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"))
' K2 X8 F) D# l, @$ J+ Z4 }( Q0 k dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
! M! i+ [9 M. H6 k. _End Sub < >'*********************************************************** 7 {; h6 R: t, |$ t) O% H# `1 m
'* PrintDatabaseInfo
8 l/ z. ]/ \) ?; I& V8 i: g'***********************************************************
8 @; M/ @8 N# @0 u8 FPrivate Sub PrintDatabaseInfo(byval DivSetNo) ' S1 k& _+ }& T6 I3 p
dim tbl
( R) j* l) h( I tbl = MakeTable(dbg_DB_Data) , r o- Q, p$ j- S$ S3 L$ H7 C+ |
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
" q& ~# V. j0 ^6 t0 x( v Response.Write replace(tbl,"|", vbcrlf)
' \, Q. [ z1 }3 B2 D- nEnd Sub </P>< >'***********************************************************
% N5 x& P9 N; {2 ]) A, y, E! N'* PrintCollection $ F }) x6 h: x' d
'***********************************************************
/ c. _5 g, c1 r% P0 ^- F5 bPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 2 z) T- N3 b7 o3 Y* J
Dim vItem, tbl, Temp
! ~9 }' K# D& t* ?- v0 r For Each vItem In Collection
: c+ i- Q7 s; U6 ?5 u; | if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 6 w" I$ K6 R5 _! D w
tbl = AddRow(tbl, vItem, "{object}") . [8 x4 s* L; n% U+ K( w
elseif isnull(Collection(vItem)) then + Y/ A& t; d' G0 x8 ]8 C8 W
tbl = AddRow(tbl, vItem, "{null}") ) J% j- t" |7 I- \7 W' M' E3 J$ ]0 g
elseif isarray(Collection(vItem)) then
! y# R6 ^! n8 Q$ V4 p1 r5 \ tbl = AddRow(tbl, vItem, "{array}") ; C5 J2 ~3 {5 n) X7 X
else
- o! K1 n6 E& `$ g1 v+ L1 ` if dbg_AllVars then
9 X+ p( K% Y" q/ Z) u" }( |9 ~ tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
8 f+ ~9 R$ j. c7 S8 `: B2 O/ Z elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
) S' c. d, B2 `! {5 d- O3 F$ X) u if Collection(vItem) <> "" then 4 w, A5 y" z9 r. M5 F8 y5 B
tbl = AddRow(tbl, vItem, server.HTML$ S+ C7 L/ a% X3 u# o
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
/ S5 O1 l2 N8 S6 t# y4 g else
S# o- u- v. V& B tbl = AddRow(tbl, vItem, "...")
+ Q& Y. L$ T& ~& ^/ a7 l) q9 E end if
9 O5 g3 b2 ?3 O5 X+ U8 [9 } end if - U# \- }# j- s
end if
& p+ p9 @+ O# B" \. z Next
" u6 v- C$ q0 L8 q if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo : o- H e: |! }
tbl = MakeTable(tbl) 8 b& b8 T* A7 a# ?4 Z- G% m. t
if Collection.count <= 0 then DivSetNo =2 Z; u3 S, T. g" N, [, X
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
* f: _% L4 N# m# |; _ tbl = replace(tbl,"#sectname#",replace(Name," ","")) ) z4 R: m6 o5 f: M- [# w1 i
Response.Write replace(tbl,"|", vbcrlf) 6 \. A( ?% o4 f9 Q7 |7 g
End Sub
+ S4 M" k* n# U( | s, N# @ 0 E2 ]7 K5 I) A, P
'***********************************************************
$ z. Q# J7 d5 i: G- F. I9 s5 R9 }' b'* AddRow 9 f T, P! O% o% T* z5 m# p* j
'***********************************************************
1 P$ w! c, g9 j" z+ {Private Function AddRow(byval t, byval var, byval val)
) y. b' U2 H7 U3 W t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
- E2 S. L& h1 d' s4 H AddRow = t % u, ^" P0 j% C) m1 F
End Function </P>< >'***********************************************************
0 g4 I# [: L4 o, E" e/ `'* MakeTable
8 t* }1 F, v; i. x, y'***********************************************************
/ u. @1 o/ u$ ~, { kPrivate Function MakeTable(byval tdata) . x& V1 F* M! r0 f$ y' }9 W/ Y' n
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
! h5 S; [1 Z- u$ Z MakeTable = tdata - R0 u: d( j# w9 F) d7 q% y4 y
End Function </P>< >'***********************************************************
5 o$ W9 g. k5 _, W, D2 l( W |''@SDESCRIPTION: Draws the Debug-panel ( h8 c8 b8 V/ ]5 }& v- L
'***********************************************************
$ @; J3 \% ^5 v+ j& BPublic Sub draw()
$ u: g/ d2 H! z6 K3 N# Y If dbg_Enabled Then 7 V; Z) e; N4 E. }5 E7 V& R. |
dbg_FinishTime = Now() % O: n/ [. u0 ?: }7 {0 ~! |* q
4 j; Q7 ], c- f. k' k4 b$ j Dim DivSet, x / }& I% P/ [& m
DivSet = split(dbg_Show_default,",")
* u% Q) x: i! n dbg_Show = split(dbg_Show,",") 2 a4 Q5 k% r- y( u7 O, Q
( h) k: `* i0 T9 | For x = 0 to ubound(dbg_Show) 0 W! `2 h% c8 E7 t3 }1 d
divSet(x) = dbg_Show(x)
) l3 D2 Z" C+ _' A z Next
( ?% o9 U1 }1 a9 W) R5 R
* f$ }! ?& Y8 G4 W 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>"
# T* A! X9 d/ C. o8 W: s8 S Call PrintSummaryInfo(divSet(0)) ! h! ? o/ O8 g T4 N
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 0 J5 y. b5 S' K; y z
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ) L# R8 U( U+ y! a# R' G
Call PrintCollection("FORM", Request.Form(),divSet(3),"") / Q3 ^/ c2 M6 |
Call PrintCookiesInfo(divSet(4)) 6 f: k% v3 B) n% {: g" G0 s
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))
/ n* J- s" K8 x* P) F$ P) _ Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
2 B$ a5 f/ C7 ?% [ Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
# N) C) g: t! ]% N Call PrintDatabaseInfo(divSet(8)) , y+ X8 E6 B7 R& h1 x0 O+ H
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") j0 \. p! \) T+ ?9 W, t9 j
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") $ S3 C+ M7 z/ h/ `0 u1 z& b
Response.Write "</Table>"
' Z, u6 \5 z. t/ x% B# B4 v% J: A' q End If
4 X4 J3 I- x- U! c LEnd Sub </P>< >'Destructor
; F( Q2 {: ]; s7 X' wPrivate Sub Class_Terminate() 3 q' ^+ R% @5 }& O0 Z! H
Set dbg_Data = Nothing ; ~* p2 j# N; S0 i* e, ~# f8 {
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >; ?- J8 j; N' K5 ~% x7 h$ M
CLASS debuggingConsole / {* ~7 m$ H6 w, ^
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 @4 w. L2 `; p5 |2 t7 t& H2 X&n
& H" m) m3 V) c* L& B4 A! zbsp;
0 z- c: c. y8 eProperty Get Enabled===[bool] Gets the "enabled" value
7 Y1 W# V7 @ N
a% ?# g: Y P: U- ^# ~; J {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
5 c; f/ T+ q" A* r. q 4 e# W. E* f9 e
Property Get Show===[string] Gets the debugging panel.
& R2 |% E3 |! ]0 }& u* Q, K
{2 b* V8 S# fProperty 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 q Y& t# B( z6 X; l, mPublic Methods </P>< >public sub===Print (label, output)
/ c) j( B* e1 ^) T4 U Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
0 i/ d" P; a2 E& i' _ Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () 0 `" \/ v- P& \6 ]+ S% t+ K
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
. c% r2 ]" u4 W$ gMethods Detail
& D+ N# \: B% A( Z/ u
' r" o* ^& h: e5 s# d2 _public sub===Print (label, output)
) [9 I$ {8 ~* y( Q/ lParameters: , ` N8 _. p( X; c* e# G1 i
- label [string]: Description of the variable
$ M0 Z( u9 v* X, p' P5 M - output [variable]: The variable itself
% E8 h% c- q& |
6 [3 u8 ]6 K) W' m" b8 Y6 vpublic sub===GrabDatabaseInfo (byval oSQLDB)
# r j( h6 X" _# S8 w, m3 `7 MParameters: * \4 O) f1 p7 w4 a: J9 x
- oSQLDB [object]: connection-object</P> |
|