- 在线时间
- 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"))
% p. x, O M5 Y8 f$ A% l* B dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) 4 F7 H* Z. u) J2 x
End Sub < >'***********************************************************
! g5 l/ t3 C6 y0 u* |: K$ J2 V b'* PrintDatabaseInfo
5 ]$ S; a3 g. r+ C% u/ U'***********************************************************
+ Q$ E7 x2 Q _! d2 lPrivate Sub PrintDatabaseInfo(byval DivSetNo)
, U& O+ s0 m3 l w dim tbl
' S6 ]1 q) {! C+ S; B tbl = MakeTable(dbg_DB_Data) / G8 O% z8 k0 p
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
/ q- r: o. T5 r9 G& }) E Response.Write replace(tbl,"|", vbcrlf)
2 v. @6 m6 j" l4 Z6 `End Sub </P>< >'*********************************************************** 7 x9 t& k6 e+ @# D; @$ `# E
'* PrintCollection
: C. c* D' S1 F; {7 Y9 t'*********************************************************** ' b# ~/ B& ?, @- ?, ?9 v A
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
- F$ X. I( G) l( {# H- _! ?4 c Dim vItem, tbl, Temp
" n, K( Z7 O9 b3 R For Each vItem In Collection
6 p. P$ a, { B2 V) @ if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
3 i ^# ~5 r7 F9 e$ { tbl = AddRow(tbl, vItem, "{object}")
$ O: |' ]: {! ?( i elseif isnull(Collection(vItem)) then 2 {; I0 i- H w. K
tbl = AddRow(tbl, vItem, "{null}") . b! l% ~ e) {
elseif isarray(Collection(vItem)) then ; k$ l# \3 ], @$ ?7 C
tbl = AddRow(tbl, vItem, "{array}")
5 _) q" B$ z! w( V+ q" u else
( r2 O4 E( J( y% ^3 E, R9 I5 R if dbg_AllVars then
1 J3 p% D8 S$ m7 q$ D3 w. n tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
: z* i- v H: y% ^ elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then . D& T4 k/ H5 l0 k: V; H2 f
if Collection(vItem) <> "" then " k n/ u4 l0 e$ V" j% T
tbl = AddRow(tbl, vItem, server.HTML" r$ _! b, w1 t8 K' Z% U8 M% v6 w
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 0 ^7 P) L( [" ~
else
% i% t% A1 ^: B0 l tbl = AddRow(tbl, vItem, "...") Y2 C, P' N( s( \- d& ^
end if + P# h- n6 c7 y/ g8 o+ @2 @7 W$ n, \
end if
! x! J1 l4 i" Y$ _$ R* d end if ! G- Q- R3 @1 B: x. p
Next
" ]1 D1 S8 L$ {: x2 ?( \7 S# n' G% ^' ? if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
7 c$ ^: F' W: k3 S7 J0 e tbl = MakeTable(tbl) ; \: O$ @: p# q$ E& o9 X
if Collection.count <= 0 then DivSetNo =2 " D. e! e% @5 {5 ~% Q& p& M6 s
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) T" o1 T4 m/ Q5 u$ l% J0 C
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
W& j {& C Y Response.Write replace(tbl,"|", vbcrlf) ; s9 P/ }9 K% N9 \
End Sub 6 r, x2 S0 U! p5 q! X! l
# q" s5 ?, i/ S# q- `'*********************************************************** 2 l6 m3 k2 c7 L, N; l l( U
'* AddRow r* R& C; W0 O4 ?: b
'*********************************************************** ' q/ M' y; m/ ?, ]6 D# n' d# J& X3 l
Private Function AddRow(byval t, byval var, byval val) : L2 L6 v: s( ^1 Z% E
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
, |. I3 k+ B# ~( _ AddRow = t e: M1 D r: `1 t8 P4 z
End Function </P>< >'***********************************************************
/ p0 q: r3 n- N'* MakeTable
1 Y% ^6 l7 S" o'***********************************************************
- P% C: r1 X6 U. TPrivate Function MakeTable(byval tdata) 1 Q. a0 q4 d' x$ g
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
5 X/ Q( Y m) E k$ `6 G$ Z6 `5 u x MakeTable = tdata $ J0 B4 A( H+ C+ P+ W5 c
End Function </P>< >'***********************************************************
# e x3 c! _2 }''@SDESCRIPTION: Draws the Debug-panel
+ w5 [9 M1 l# w5 K'***********************************************************
+ K- W/ d4 v: A5 J& W; vPublic Sub draw()
- S, f. ?7 c9 `! Z9 l+ O( X If dbg_Enabled Then 4 V0 O. v8 Y7 J3 I& c$ R5 C
dbg_FinishTime = Now()
5 X9 r. e: O% g4 u2 R# ^2 c1 N W
- n+ J9 ~/ W3 K8 P8 K Dim DivSet, x
" s: K7 e1 @- c DivSet = split(dbg_Show_default,",")
2 p" V$ B, L; @5 `8 D( l( p dbg_Show = split(dbg_Show,",")
5 F9 P9 A- a1 _9 M: Z
( j0 k9 U3 I' J3 m1 I& Z+ k6 Y' _& Q For x = 0 to ubound(dbg_Show) ' D/ i+ U) f4 }: d) o2 i) M
divSet(x) = dbg_Show(x)
/ J6 y8 [3 o/ }/ |( \ Next
1 n5 X2 f' y7 }8 o0 \8 p$ B) i * T$ h$ e: F- e* p3 m) {
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>"
$ L* z1 X' O: z p! B# y, O0 h Call PrintSummaryInfo(divSet(0))
+ F' O3 j( g& N Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 7 }5 S$ a( G) B) @5 p. R! W
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
, m# i' J* |5 m# P; w& u) g( l Call PrintCollection("FORM", Request.Form(),divSet(3),"") $ x/ E) f' y) e, f+ t) o5 y/ R6 G, F* E
Call PrintCookiesInfo(divSet(4))
9 a4 y8 Y( \: F+ ~8 u$ ~ 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)) # G3 I, f* Q2 d# }( M5 q8 \+ z
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
* C) ^, X0 P$ Y Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
2 m' u3 `' S2 a& O( \$ D( l+ a Call PrintDatabaseInfo(divSet(8))
4 G) C$ B6 L" R5 v2 V6 k; Q# d Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") . }3 g4 s! ^# F- W7 l
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
) V: j- S- f& _# A) E* C! i Response.Write "</Table>"
& d# P6 Q5 n. ^& N: `: Z- m* g# H End If
! l, C L% N( z# l2 TEnd Sub </P>< >'Destructor ; S; a7 \- }" c: }+ a' C
Private Sub Class_Terminate()
& Y+ C1 j6 ~% |8 @) _ Set dbg_Data = Nothing
- J. m W5 \1 `/ L) Q0 }$ |8 ZEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >0 _) h8 C) L, N0 `$ c
CLASS debuggingConsole 3 M ?" w! K, j; [7 _1 H0 r
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false ) _" N3 S7 T& }2 o& K/ Y
&n9 Y, f* R# P& ?" I$ L; ^! I4 ^
bsp;
0 j# j5 C. s. h5 H2 E+ Y bProperty Get Enabled===[bool] Gets the "enabled" value ) g- ]. @3 h' R. T
. D% D& Y4 m- x) J/ Z. O* RProperty 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 + Z v& S) S% L, T% o0 [+ j
8 g( O8 d9 o$ O: M7 c8 W) \ ], n r
Property Get Show===[string] Gets the debugging panel. $ M9 t- ^# j8 _
% N2 ]# `" X# }
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>< >--------------------------------------------------------------------------------
8 G5 A C P5 O4 D0 c# M% MPublic Methods </P>< >public sub===Print (label, output) ' w- l% Y5 o# t) i+ O
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) " }( D2 V0 S' P5 l
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
* i) i$ |/ G. H1 C Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 4 l; v7 ^, x1 l! z: _5 w4 r* T
Methods Detail . ~" {0 N; A8 H! o, X0 i- B
7 Z8 ^5 k/ J1 Z8 d$ J4 xpublic sub===Print (label, output) 5 j/ W9 O3 c9 A
Parameters:
9 i7 H! ~/ l: _! {2 f. c, j- u+ u1 J - label [string]: Description of the variable
% f+ o9 K5 r7 e% r' {% B1 f# g - output [variable]: The variable itself : C4 s% R+ o; w. R5 p4 t- `
9 x# m+ [$ ~+ `public sub===GrabDatabaseInfo (byval oSQLDB) 3 h# f2 p/ Y5 ?9 X' {6 ]1 w
Parameters:
% O- a2 }$ k; ]( F1 o# w l - oSQLDB [object]: connection-object</P> |
|