- 在线时间
- 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")) , m' c, y( o! t ^# { a: S# k
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) j7 c& i7 |. |) Q+ u7 s/ B
End Sub < >'*********************************************************** ! p* D: M6 Q! m
'* PrintDatabaseInfo
4 A( k6 O: |8 e3 d0 \& T: O5 B3 E8 R'*********************************************************** ; d7 g* O7 G: G
Private Sub PrintDatabaseInfo(byval DivSetNo)
+ s# X p7 f; g7 @* P* z. j dim tbl
& b" c2 k" g3 h* W" c9 Y% @: E# I7 ^ tbl = MakeTable(dbg_DB_Data)
$ [0 Q s3 C! Q" K tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
$ {5 c: U- `5 k; x, o- t9 F Response.Write replace(tbl,"|", vbcrlf)
' U$ P$ K) d+ x- Y0 Y) SEnd Sub </P>< >'*********************************************************** + e/ L. B% Z, H! d) J, q& R# c
'* PrintCollection
7 ]8 z8 L; r) A+ ?! m) l2 ~! N'***********************************************************
2 _0 u$ v s; L: P8 E3 ePrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
4 h; Z0 Q0 M: f Dim vItem, tbl, Temp
6 y; X) V9 @+ r( E b5 ]' u' k, ] For Each vItem In Collection % v* S6 z& y; n
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then + N4 c9 m' A* ]6 M. k% `( c% k. N
tbl = AddRow(tbl, vItem, "{object}")
0 w% f: w, |! N5 k4 Z* D' S elseif isnull(Collection(vItem)) then
! d5 ]* j x, q; a$ T$ J6 S$ | tbl = AddRow(tbl, vItem, "{null}") + y' m$ O2 ^7 t2 E5 U
elseif isarray(Collection(vItem)) then / z4 D7 K* ], K* C0 b( S
tbl = AddRow(tbl, vItem, "{array}") v# C: p, i" J1 z$ e$ W8 r
else % z, E O. s/ T# b0 Z U/ C! _$ F
if dbg_AllVars then 1 N' M+ d5 P0 r- q+ [
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 6 ?: e& I6 `8 `6 h, S1 v( s& i$ Z
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
$ s! c; P6 w8 m) F# W: z if Collection(vItem) <> "" then
+ A6 V* ?) C% C) @ tbl = AddRow(tbl, vItem, server.HTML
. l1 {' M% A! j3 T$ I3 L4 {0 EEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 7 r& q2 V- T5 Q) |+ l
else 1 Y7 ^6 d2 g! K7 i
tbl = AddRow(tbl, vItem, "...")
, T0 J6 @6 Y% t5 P c% w* x9 ^ end if
$ d2 G9 G ^( u( V+ U9 `7 ` end if
: `6 P2 t; E) O1 ~0 Y4 N" c end if ; x. R6 S1 W/ b0 U$ u& X: M9 C C
Next + j& {' o4 h" O( k, L6 }5 A/ g! }/ v
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 9 _% _" y1 C- K/ v8 g: C
tbl = MakeTable(tbl)
, m( u: q6 y+ Q" v if Collection.count <= 0 then DivSetNo =2 ! \+ A* u+ u: n/ X3 E
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
# I7 N" ]$ m) B5 ]- U tbl = replace(tbl,"#sectname#",replace(Name," ","")) + I+ w1 @" T" R. O# `) e
Response.Write replace(tbl,"|", vbcrlf)
$ o8 u! C4 I; Q; [; w5 i& Y) `End Sub
1 u! e3 ]2 F; q7 g+ }5 t1 ^
( }5 w, X, {. w* U2 n4 @'*********************************************************** ! d# A; F/ }$ W+ R* U) f, p+ q
'* AddRow + {) W: X2 t ] |- h
'***********************************************************
0 W9 Z6 r& _2 O3 PPrivate Function AddRow(byval t, byval var, byval val)
]/ a; e' u4 q$ F6 I: |9 T1 s5 A t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
2 x) E0 H& t& ?$ F( w AddRow = t
# M d. Q$ ?( f0 v/ }End Function </P>< >'***********************************************************
9 d( Y: y s* ^! X: x P' i4 V/ w'* MakeTable
+ B/ ]& K4 i* w* z, v. j'***********************************************************
& r$ |7 x y6 d* X9 tPrivate Function MakeTable(byval tdata)
2 M* M: r" P" b/ O" v# @ tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 5 w5 W4 e" T; K/ _ Q$ K
MakeTable = tdata
2 ^8 v, v' P: J4 R0 ^; [End Function </P>< >'***********************************************************
* S6 c1 a' U' ~: x0 D6 I''@SDESCRIPTION: Draws the Debug-panel
; r$ v& W+ Y+ Q7 `; @'*********************************************************** * l" r3 x6 }' t3 p
Public Sub draw()
1 }& m; m/ L. |- P If dbg_Enabled Then
6 B, h4 O) s+ |1 r) v( b dbg_FinishTime = Now()
; r% f1 l- k) j( h- e. Q
# k* \/ Z- J! W$ w8 ~0 Y Dim DivSet, x
/ [9 s5 V& B0 T DivSet = split(dbg_Show_default,",") " `' [$ I R2 v+ G, v8 Z
dbg_Show = split(dbg_Show,",")
7 J: |9 U8 F0 J$ `9 j
( d/ t1 F/ E$ i$ V9 r Q For x = 0 to ubound(dbg_Show) $ I; Q; c9 q7 {* g/ H" _; p, ?% l$ X
divSet(x) = dbg_Show(x)
5 p, t6 N; ?5 d+ m) b0 q' o: t Next 4 ?: E. s& D; V" k3 p
6 ~9 A# o, H5 D 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>"
* e4 K8 V0 J$ b6 w9 k0 C+ l Call PrintSummaryInfo(divSet(0))
' ~2 y. U( Y. g: G* e Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
3 N. c0 o& n9 u$ K: Z9 U Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
; c) W% U, u! f9 ]( g5 k Call PrintCollection("FORM", Request.Form(),divSet(3),"") , i+ z( r* F& y6 D
Call PrintCookiesInfo(divSet(4)) - G: L0 u4 O; w6 Z) l
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))
' L+ l' T+ \1 [3 ~$ d+ ]# U3 [ Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
. ]. _. V- X- v9 m' O7 H Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
# u0 ?% x6 ]# v7 q3 R9 _2 z Call PrintDatabaseInfo(divSet(8))
$ C9 q2 }2 n0 q! Y! Y Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 3 D( Y0 v/ S- G: o) @- g( Z; X
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") , j/ U$ B/ a% U
Response.Write "</Table>" 0 ^+ i$ R4 T7 l/ N, ]2 Q
End If * B3 z; m- l6 m0 c ?
End Sub </P>< >'Destructor
$ J# d& p$ w; C' R' P3 IPrivate Sub Class_Terminate()
6 I3 `* Y+ h- H4 c$ c2 z/ t Set dbg_Data = Nothing
4 m% P# j5 j5 `) o" p8 pEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >- D4 _5 M( L# y7 T- E) R; w
CLASS debuggingConsole # n/ C0 \1 c7 u8 {' r; i/ J; j
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 6 }1 Y* W2 e8 j/ [. F# u3 F6 V6 p
&n+ Y) t$ P4 s7 o: z! j8 ^
bsp;
3 i# t8 [( t x- r9 s' o- RProperty Get Enabled===[bool] Gets the "enabled" value & ~! d: y% Z! g0 K( D
. s: h! e; T: q# ]
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
2 z! _1 h7 s! y! n& ~8 y, a( |
7 {' R% E: \ ]& `Property Get Show===[string] Gets the debugging panel.
" {2 `9 M6 z q: r6 E7 K& `; U
9 ~/ \' ~9 v: g, p9 X& W6 z% ^: OProperty 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>< >-------------------------------------------------------------------------------- - a: d Y, j- @9 z* A$ X( D* V7 t! c
Public Methods </P>< >public sub===Print (label, output)
0 Y; f* E9 I6 H2 W% U Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) " {" a* f0 G- |' C; W) B% ?6 V/ u
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
t2 l/ b3 ~" q- _% M ]2 g Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
9 [: t+ J7 {' ] X' } KMethods Detail
I! `" H& ~: w& Y) |
/ j) I' Q0 b# I: l0 J4 Ypublic sub===Print (label, output)
% V0 J; e6 B! D; @) D9 i) G4 nParameters:
3 p& t, A! e3 [2 q L - label [string]: Description of the variable 1 \3 I9 E; N7 r- B
- output [variable]: The variable itself
h, c" ^- d8 W* P7 B( _
$ t+ r6 y+ a5 N4 ^public sub===GrabDatabaseInfo (byval oSQLDB) ( w6 i% ~* W% e k/ b) S9 S
Parameters: / V5 o* e$ s% C
- oSQLDB [object]: connection-object</P> |
|