- 在线时间
- 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 }0 |8 q0 B/ M dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
# J+ l% D" z9 HEnd Sub < >'***********************************************************
; a' o* K! \ E. g2 a0 C'* PrintDatabaseInfo
1 z3 P4 m% f- T1 u) D- q'***********************************************************
+ C- A- @2 C6 x: c! v& d! @Private Sub PrintDatabaseInfo(byval DivSetNo) 6 h5 N) V5 B0 h) i# I; K8 ?
dim tbl 3 g9 Z2 c+ a0 U5 U: p3 s
tbl = MakeTable(dbg_DB_Data) # W/ `) d o% e$ u$ G/ h2 ?" T
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ) I, p" n' u4 ?
Response.Write replace(tbl,"|", vbcrlf) 0 f. Z3 Q3 |9 Z3 o8 {# n
End Sub </P>< >'***********************************************************
9 D( o: M- U8 B3 G$ V& P'* PrintCollection - i' O4 C, g2 } Y7 h: P0 `' l
'*********************************************************** # d4 U* L% ~+ V# N% ~, Y2 T
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
) l0 f/ q, i3 U( x8 N Dim vItem, tbl, Temp 1 M* f" o) Y' t6 q a! c" [/ w
For Each vItem In Collection , w' v$ B% b; P6 ?8 B
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then % H8 ^9 x1 n# k9 x. b8 _# w
tbl = AddRow(tbl, vItem, "{object}")
9 a# V1 D4 {$ e" D- k! j elseif isnull(Collection(vItem)) then
7 W) W* _ t6 z2 m/ N1 r" X tbl = AddRow(tbl, vItem, "{null}")
7 L! C# n& C5 ~0 s0 _* U" ^ elseif isarray(Collection(vItem)) then ' o7 E$ v/ [6 d( X, F# n7 ~* V9 u
tbl = AddRow(tbl, vItem, "{array}") $ o, X* {$ N* I$ L9 x
else
0 ~1 A' O" J) s: @2 B if dbg_AllVars then . q8 y6 j# |% F) \( q, Z
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) " ^# E* d; c: I5 }, J1 D/ F1 Y0 c5 G% Y
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 0 C W% W3 B% O6 e5 V1 s
if Collection(vItem) <> "" then : O" C" K0 n; L: p4 i
tbl = AddRow(tbl, vItem, server.HTML8 W# R" P) t: S
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
% H" A2 A0 }% X- v3 m else
4 d- R) H7 a; J) M6 C% D tbl = AddRow(tbl, vItem, "...") ; a& p) z k4 \7 R* Y' {+ E
end if , n3 O* N9 K& M# N$ z
end if & f5 N8 a$ x( S* [4 `- s
end if 5 q( U1 |: ]6 K, D- s$ [
Next 8 }7 n" z: ~! B! G7 m% P; X: C5 ?
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
8 A( B8 l) d0 V( y% U" d+ s/ d tbl = MakeTable(tbl) 0 I# O( ?! O6 |. }: @. t* x
if Collection.count <= 0 then DivSetNo =2 & U8 J0 g$ e: A/ j1 R6 c; l* x% n
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) / c2 O9 V! M. G0 \
tbl = replace(tbl,"#sectname#",replace(Name," ","")) 1 @0 a& n0 {' m6 N* v9 {3 U
Response.Write replace(tbl,"|", vbcrlf)
1 B- I. p# y! f7 T& w6 {End Sub
# {, S/ B% }: R, F9 w: Q
g; H8 f% A4 X" n4 O$ p. N7 j'***********************************************************
: m9 I8 O) e5 G+ ?. Y5 D* \) b( G'* AddRow 5 Y# |. y* W5 l
'***********************************************************
+ x9 f& f# @2 W1 y. n5 kPrivate Function AddRow(byval t, byval var, byval val)
+ B% c; a% r- [ t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
! f) s! M: L- }! F# Z0 t5 C+ V" Q) j AddRow = t
5 J& \9 o# y ^2 L! _4 EEnd Function </P>< >'*********************************************************** # D, f0 ~3 F# g. J; M
'* MakeTable
; T8 n; i9 K8 N9 S" g7 Q& b" e'*********************************************************** 4 Z2 V( Z# m9 A! Q( O" p+ Z
Private Function MakeTable(byval tdata)
2 l$ ~! w; x( T) {1 [2 Q tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
1 ^# |; B( i" G: f MakeTable = tdata ' K7 Q; G4 I* f
End Function </P>< >'***********************************************************
' \* i! U- [& c% W1 s4 D1 o0 q''@SDESCRIPTION: Draws the Debug-panel
: _8 H, v1 ?/ ~2 @'***********************************************************
& I( h% s4 ]$ ~5 B0 ]2 [Public Sub draw() 8 _1 R" I* q5 p4 Y* ]" G: p: I
If dbg_Enabled Then
8 I& x8 b2 o9 L( ?) ? u$ x! r dbg_FinishTime = Now() 9 [2 W6 P O/ \/ d* y7 R4 T
- t5 b. T& T' U& O( _* G
Dim DivSet, x 7 X- r) e1 Z" J0 |6 |
DivSet = split(dbg_Show_default,",")
|1 h* Z' _$ h1 f5 R dbg_Show = split(dbg_Show,",")
+ d1 c: S3 a9 ?- ?7 U$ B7 R1 B+ C6 M
5 O% [; X! B6 c) ?; M$ e For x = 0 to ubound(dbg_Show) $ }, }9 n6 U" w- l% k( H
divSet(x) = dbg_Show(x)
* j* G9 I3 K* z% ] Y Next 2 T3 |7 M* k" Y, {* Q
* {/ B. w- l; ]/ 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>" . E$ J- E9 ?! e$ `2 H5 o
Call PrintSummaryInfo(divSet(0)) 7 s3 x3 j+ n6 w1 B
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* ~7 Z% Z3 H" R Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 7 K6 w8 D1 r7 ~- K1 @; z2 a
Call PrintCollection("FORM", Request.Form(),divSet(3),"") & o- `2 q4 i0 V" N! a0 m
Call PrintCookiesInfo(divSet(4)) # _2 N1 u4 H* k1 N* 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)) 7 |1 V6 `/ E+ z
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
4 a; {3 P; B" R* e7 G Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
7 j4 s! j% X" T$ B9 q U) ]* L: }6 b Call PrintDatabaseInfo(divSet(8))
4 a4 d: r6 L' z. P Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
) v% g. C0 K- X- x Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
) K& \+ {+ D* @! D1 J$ g2 v Response.Write "</Table>"
/ b# s( ~& C0 } ?0 m; v* s End If 2 z6 e9 e% O) e5 v4 \: G! q
End Sub </P>< >'Destructor
! Z% L+ s: r4 ]* c) KPrivate Sub Class_Terminate()
8 d8 l+ S" i. w x Z Set dbg_Data = Nothing " V3 A0 N, J* N- ?+ x2 ]; c7 `
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >2 S4 P/ ? D" D1 h$ f0 v' Z0 t
CLASS debuggingConsole
h, \: }! \! O2 ^8 J4 TVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
) r' K) ~. s( C2 a&n4 J' N6 s8 _* M9 F2 b0 B( N
bsp; - Q2 ?5 ?1 E- ?+ o# u
Property Get Enabled===[bool] Gets the "enabled" value
( k; s$ a* v3 U2 B ; I& o9 H0 w9 _: s8 w$ i
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
, ~. q, q8 F% I8 x( y* \6 U v; S+ [! m, [5 Q) h+ y2 {* c# T
Property Get Show===[string] Gets the debugging panel. W) Z) x. Z( y( Q: j/ k
! I' q- a! i/ Z% O, l
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>< >--------------------------------------------------------------------------------
' g: |' o( w# GPublic Methods </P>< >public sub===Print (label, output)
! i: Q: y% D9 l6 l9 a* h Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
8 e. Y# ?# T) G+ }. o( N. j Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
7 |- A3 o* D/ O Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- , d3 z+ [* d( f0 e0 m5 J/ b4 Z
Methods Detail , W; C8 ~8 a% J. X( ?9 }
- z" Q) G; \0 t& Cpublic sub===Print (label, output) ) l9 Y/ I: H: z) R4 @1 |* L+ h
Parameters:
1 }+ u! v7 A0 y$ E& J% h* y( D - label [string]: Description of the variable
, _) g, V$ ^" J( q+ l - output [variable]: The variable itself
' y/ F0 t+ } ~9 b+ [ _! ~
7 n s" ?* r- a+ o* r8 Tpublic sub===GrabDatabaseInfo (byval oSQLDB) 7 | m$ W+ \; c# Y7 C( D. U$ |
Parameters:
. S5 j2 y# d" D N - oSQLDB [object]: connection-object</P> |
|