- 在线时间
- 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")) , E: \+ D5 F# o' h. M3 E( X( O6 u
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
8 Y& T0 ~( }6 F5 IEnd Sub < >'***********************************************************
; m2 w4 d; _+ x. }/ ?% D w'* PrintDatabaseInfo
: b6 s# c" m( p' H9 q% X'***********************************************************
0 K( A' \/ r nPrivate Sub PrintDatabaseInfo(byval DivSetNo)
1 E& C5 B# V# S0 A3 P* n9 f dim tbl . {: m1 l( ~% S+ x7 E/ \- V
tbl = MakeTable(dbg_DB_Data)
9 i m/ m5 N% x! F: h tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
) a. _1 H" c) z Response.Write replace(tbl,"|", vbcrlf) & K$ Y& C" i* Q3 H: K
End Sub </P>< >'*********************************************************** ; }9 b/ j3 `! m
'* PrintCollection
4 l% e: R3 q5 u% E'***********************************************************
p1 M# j0 V* i2 D" _2 H5 mPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
9 s8 [, d4 _) @& K Dim vItem, tbl, Temp : k+ q7 t! g( B i* U
For Each vItem In Collection ) e3 u& E8 k: }& i6 {9 t
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 2 T& y9 C) }+ d. h
tbl = AddRow(tbl, vItem, "{object}") $ c' p9 q9 t/ ^; l
elseif isnull(Collection(vItem)) then 6 k. Q' e. z$ T9 E$ r u& _
tbl = AddRow(tbl, vItem, "{null}") % j( q, W: W; K4 H, ]4 s
elseif isarray(Collection(vItem)) then * I1 v/ I5 c. @) ~8 [
tbl = AddRow(tbl, vItem, "{array}") . x+ k! k u% s; {* _. b7 |" d
else
6 j* A. T d: J) }/ T5 @, S; g if dbg_AllVars then # z/ W+ M1 r7 U
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 6 i9 d. K* u0 @3 M# l2 Q% v, a
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then & _5 J& Q+ g- R5 x; m; b
if Collection(vItem) <> "" then
# e9 `& b. O5 U! {, o tbl = AddRow(tbl, vItem, server.HTML8 x0 y+ Y4 t$ {2 f
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 4 n @7 C3 w) u
else - B" L: r: p2 { M$ \
tbl = AddRow(tbl, vItem, "...") X2 v# _' R+ y d$ T3 k! b/ J
end if & U' z/ e6 I; K1 i
end if
2 ^( t, z4 M5 @" O, G end if
( F. b# p) T/ S. L3 N; z Next & i; ^4 V" Y" S# U; H; L
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 3 {4 |, y9 ]$ q a/ W
tbl = MakeTable(tbl)
7 L- l t. t& f2 A if Collection.count <= 0 then DivSetNo =2 , z* @ g# O4 z' y D* A, E; F4 p3 f
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ( a3 H2 b( R& Y) c) d
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
( U; x0 T( ^& S+ B9 ?' v Response.Write replace(tbl,"|", vbcrlf)
% X& K* H4 k7 n1 q. Y. w BEnd Sub 5 c0 N3 r* ?5 R$ j: l) x: d! ]
4 R; f( ?) n* q6 o'*********************************************************** 7 N% J" Y# @/ [' ~
'* AddRow
& p7 U4 h. s4 a% w5 ^1 b0 p1 E'***********************************************************
; u- v9 U2 C2 d& K* t! kPrivate Function AddRow(byval t, byval var, byval val) 6 \! j% _& G7 H
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 5 Q( N: L- a9 u& ^" t( H2 \
AddRow = t
' m6 N$ w2 v2 O9 j4 {End Function </P>< >'***********************************************************
, ?7 W. y& o$ w8 ?! J: Q2 ^'* MakeTable
: _ m' A& @# w0 V8 E o2 m'*********************************************************** + x V2 |4 D% ]+ y" Y
Private Function MakeTable(byval tdata) ) F! L! }% t" p3 m4 p' q
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" * T: K4 o8 f) J" o" r
MakeTable = tdata ' b) G7 _6 f# W
End Function </P>< >'***********************************************************
6 Y6 H7 n( Z/ W5 J: _0 d' W''@SDESCRIPTION: Draws the Debug-panel ( N, n5 Z; s! K% h# c8 f8 s( M
'*********************************************************** 0 c5 \. _# _ T. _
Public Sub draw() ( m6 J1 i+ B6 U U
If dbg_Enabled Then
1 r8 \0 p5 O8 T& L dbg_FinishTime = Now()
s& S5 f* s* r
' j# ~3 s5 m. F, Z Dim DivSet, x
6 M9 z2 M4 U# e! \$ u8 X DivSet = split(dbg_Show_default,",") % d+ @2 N7 I! b+ M8 B
dbg_Show = split(dbg_Show,",") / D/ s7 {2 q2 J* }
% O, m: e; B; q+ n' L) p For x = 0 to ubound(dbg_Show) / \4 ?" a* Q! r. M% C; b
divSet(x) = dbg_Show(x) 7 W9 z R3 P; ]8 D; X
Next 1 c$ G& M; \9 M* o
0 C5 x( @$ z! r* f0 N9 n. 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>" : r3 {" a; O1 G6 a6 r4 v) l
Call PrintSummaryInfo(divSet(0)) 5 X8 o, P. \# R1 s: e
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
( x8 N d, M" i x" ]) w# M) ~ Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
) N3 J8 z3 K3 g; _% k0 ]( {% v Call PrintCollection("FORM", Request.Form(),divSet(3),"")
: V9 w* }2 F+ U+ i Call PrintCookiesInfo(divSet(4))
% ~ U4 g) C1 I 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)) ' m3 P) M V; ~# T! [4 h
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
$ A i9 G8 S: a$ B Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) . S) ~4 k# F" A2 \# D5 F
Call PrintDatabaseInfo(divSet(8)) : }, \5 Q9 ?/ B: s" B1 O; j9 B0 X
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
& J7 F2 V+ {. U- T3 B, \ Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") - O! L7 `# y3 W1 v
Response.Write "</Table>"
. @! ?" I, `# B End If 2 r6 I& R9 M0 p
End Sub </P>< >'Destructor 9 b. Z2 R6 B3 A" r
Private Sub Class_Terminate() ' V+ ^4 e; S- p2 l- b
Set dbg_Data = Nothing
9 U2 E' H# k# b* X" A, zEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >6 [8 [( s M6 C
CLASS debuggingConsole $ h. R' Z: `7 r; O" v; e+ x% C8 f* i
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
: z, b/ t# D" a; d8 Y7 [% C&n+ W" o7 p/ U' @/ Z# d6 C
bsp;
?7 P, F# C& _9 j. wProperty Get Enabled===[bool] Gets the "enabled" value 8 a' N9 c0 P4 u1 `" O" V2 `$ J
* [& T/ `7 v, {9 Z
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
7 ^: ?1 {) t1 v2 w7 |" K. Z5 r 1 u: G) i' @/ o4 ? K* Q& [6 _) o
Property Get Show===[string] Gets the debugging panel.
# C" G& i. ]' z, M5 j4 P) r
, {2 j0 R: O- `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>< >--------------------------------------------------------------------------------
* Q! P j+ q2 G \Public Methods </P>< >public sub===Print (label, output)
0 _) u0 ]/ e5 I3 R Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
% O% P |' k+ Y Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () 6 H% f1 f O0 u, a/ I( x$ t
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- . C6 i* g6 t, e+ V8 e6 ^8 Q7 F4 V1 j
Methods Detail * e8 f" [$ Z- y0 V) V( z E
8 T0 n4 q& r0 I! }/ {9 d- ^public sub===Print (label, output)
) ^1 l( z R, m" M- tParameters: % J9 M4 z/ N- g( i4 L/ ?; X. I
- label [string]: Description of the variable / ~# N+ \0 f! b5 O
- output [variable]: The variable itself
3 q8 j% i3 G8 Z& p
. D: K e& j' d4 _% l3 Bpublic sub===GrabDatabaseInfo (byval oSQLDB)
) l1 ]/ k7 ~$ ]8 N1 uParameters: L4 d( j; \. x9 M3 u
- oSQLDB [object]: connection-object</P> |
|