- 在线时间
- 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"))
4 i# _7 T: k* Z( y6 K- }" D dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
6 R x9 O/ q; p* }* e) jEnd Sub < >'***********************************************************
3 R" f) x/ B5 y7 u; c3 A* z1 [1 d'* PrintDatabaseInfo
. ?" I+ P: d4 u! G'*********************************************************** ! _( F: q+ p3 I. O0 L8 d9 X6 _
Private Sub PrintDatabaseInfo(byval DivSetNo)
1 R! j) I5 p) h7 L M. t2 Q dim tbl
+ f1 \6 P( U+ `+ C" r8 J: @7 Y& W tbl = MakeTable(dbg_DB_Data)
s8 R3 @& N( Q* Z; a8 T1 n tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 1 |/ h/ E z, H4 X, d
Response.Write replace(tbl,"|", vbcrlf) & J0 m9 ]: A. n0 l
End Sub </P>< >'*********************************************************** 0 w* U+ p. F6 Z" ~
'* PrintCollection
$ x8 Q5 `4 u% ~. v8 N'***********************************************************
/ x6 @# E- t( C% I/ k! y$ j9 |Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ! r2 y$ ]6 q4 Z9 x3 a# L
Dim vItem, tbl, Temp
; o/ ? r& [$ @' O3 b9 [ For Each vItem In Collection $ Y9 Y& Z2 f- H1 d
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 1 Z, k8 V: | D" |' M$ C) ^" s
tbl = AddRow(tbl, vItem, "{object}")
+ z/ G3 C! a9 { M, `# s' D5 ?2 W6 c elseif isnull(Collection(vItem)) then 0 ?* }' x" z* ?6 z9 Y, K8 q
tbl = AddRow(tbl, vItem, "{null}") ' H$ e3 @# w: f p6 i+ Y
elseif isarray(Collection(vItem)) then
* C* k9 u9 R8 d. ^* f+ M% k tbl = AddRow(tbl, vItem, "{array}")
7 g+ m! N2 W+ {$ P1 [6 z else 3 ^/ C+ o* j; W4 O& P0 N; Q
if dbg_AllVars then - h% Z; Q4 N9 v$ O* F& f
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) & @3 [3 s8 Y5 q: h: t. v9 X
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
$ f- V. R3 a/ B" d. d2 w; f if Collection(vItem) <> "" then
3 f0 w, x, e. C; X% f$ G tbl = AddRow(tbl, vItem, server.HTML
8 F/ T1 G5 r8 K" [: D1 b8 U2 b% tEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
, G5 _* V" ]1 M else ; b1 ]# _% O7 Z5 j8 B
tbl = AddRow(tbl, vItem, "...") 5 C/ K) s! P6 T: a( l
end if
, O7 V( C- R! V9 N; g end if
3 Q9 w0 t) `( t8 Z* I8 \5 @6 s end if / a& G& r6 L! u. d; L" A9 d. T
Next
1 K; x3 O6 r; K$ s if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
) d1 I) U, r: k) b tbl = MakeTable(tbl)
, h' e* N. t7 k* A9 M2 i if Collection.count <= 0 then DivSetNo =2
& x F0 N& X2 i tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
% h- E# R# O2 F0 x; ^6 t tbl = replace(tbl,"#sectname#",replace(Name," ","")) 5 @9 `) ~" k8 z, r2 l, C
Response.Write replace(tbl,"|", vbcrlf) 1 U& Y! {; a7 D& M7 k, k; {; q
End Sub
/ `1 w& i0 }, S
. d& [4 N! x _'***********************************************************
+ D2 n+ }) N+ ^- X1 l5 B' @. |0 y" y'* AddRow ( V$ ~* b. g, F: C* B
'*********************************************************** * x4 j! Q* H: _/ f; @
Private Function AddRow(byval t, byval var, byval val)
; \* f- b8 c d3 e t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" # E+ X- f+ u* l3 k; S
AddRow = t 1 P( f& L' x5 |9 Q
End Function </P>< >'*********************************************************** ! S1 K( K+ C+ G1 m
'* MakeTable
, P) y& k5 b5 E+ E a) W* l'***********************************************************
! i' ]9 |7 V- P9 q9 Y' v+ UPrivate Function MakeTable(byval tdata)
R3 x0 m4 w, }3 |( r tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" ' x) I* E) ~+ K
MakeTable = tdata
$ ^9 G, T+ m- i$ ~3 p1 C' `3 }; SEnd Function </P>< >'*********************************************************** # Q1 Q" f8 ^. n, B: }' d1 D
''@SDESCRIPTION: Draws the Debug-panel 8 n$ i' k$ F. u1 e! }7 \
'***********************************************************
- g' U9 \$ @8 S9 i9 cPublic Sub draw() # ~# I2 s) g# b2 W' {
If dbg_Enabled Then 5 O$ {$ r5 a" U( M+ S
dbg_FinishTime = Now()
$ T5 Z# E7 n' T* H* B; g
" D' d& p$ U3 ~) Q' G Dim DivSet, x
3 Q' }2 D0 D3 X) @+ u$ l& ~ DivSet = split(dbg_Show_default,",") + P! A4 V3 ~% v$ ~! B; g5 T
dbg_Show = split(dbg_Show,",") # s9 @+ F* G# n8 k
/ B A9 R3 @: \; h For x = 0 to ubound(dbg_Show) 2 M7 P4 x, z) C
divSet(x) = dbg_Show(x)
2 B& j& l4 f6 p! [% `: [: r Next 8 H2 i6 O# K1 j1 s
$ }, {$ D6 Y: c# B6 s: ?7 z/ r
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>"
6 P, Z: j& I3 `, O Call PrintSummaryInfo(divSet(0)) ( G8 I8 B+ s- D' E, d Z, H% q
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 6 h, K- J* Q: D/ d% @
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
3 D3 P/ i# `* I: N: n Call PrintCollection("FORM", Request.Form(),divSet(3),"")
# e7 D& C% d( J5 C2 { Call PrintCookiesInfo(divSet(4))
, U, c2 A; H2 L, ^, i: 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))
( {4 s1 E# P+ D0 d4 ?7 } Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
9 u4 d) ~" L- [! p6 X+ V# r& i Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
( I$ M h" k6 W, F( r" |# M o5 r% g" s Call PrintDatabaseInfo(divSet(8)) , ]* e- h F6 Z9 |; V" E7 G
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
; c* c( x3 x& Q# g. e7 n: H Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 7 |6 k: y1 R$ l2 V4 M; Q, F
Response.Write "</Table>" # ^9 |, Q; v( t$ ?' ^6 |1 Q
End If - p3 a9 @3 F8 Q3 J
End Sub </P>< >'Destructor
9 x; ]/ l# ]1 N+ D# hPrivate Sub Class_Terminate()
/ Z1 O7 g6 O$ N- f7 p- [ Set dbg_Data = Nothing : B0 G8 O4 H3 `7 m$ R: i
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >* U! `# ` x6 a7 _
CLASS debuggingConsole
- N; v0 x- R2 B- B" O! [Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
6 f; |% Q' q' P, `# v: L5 x% r&n8 L) y: M/ j$ w9 \- q# @+ V0 ^
bsp; & i1 V/ g4 k% b( Z; J9 t/ N
Property Get Enabled===[bool] Gets the "enabled" value
2 W( A( r8 [5 [3 E& R2 X# n
& o9 f$ C) w4 H# t& x5 W2 Z4 HProperty 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
! W, D8 B7 W$ o. \ W' \7 q 5 l: n, x4 C) y7 {
Property Get Show===[string] Gets the debugging panel. * Y" q; N; C8 b1 ^/ R* h
& K+ X" O+ s/ A0 iProperty 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>< >-------------------------------------------------------------------------------- 9 J4 L( \1 p/ U: c
Public Methods </P>< >public sub===Print (label, output) 7 H/ R( _ e8 v
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) g! g1 X6 ~) i& y
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
& ?: C3 C% ^# g$ Z4 t# E( V+ {3 B6 K Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
. {3 S& h. p* ?- K& [9 t" T6 AMethods Detail 1 o* g7 P# m D/ _3 N
4 d7 ]. s' v* @- W) M$ R- }8 V
public sub===Print (label, output) / s+ G/ [8 F! L% O# @9 O; m
Parameters: 1 B( I- D8 I# ?* S7 w% _. s$ ~- B
- label [string]: Description of the variable ) {: l$ i! e3 @* g* S
- output [variable]: The variable itself 5 A) l8 x# \3 V. ]
# Q0 k* o! ~! |0 U/ c( ~# jpublic sub===GrabDatabaseInfo (byval oSQLDB)
6 a* r" q+ ~: ]7 j7 _Parameters:
$ }) u/ L% t$ t9 F* o5 D9 }- \/ C - oSQLDB [object]: connection-object</P> |
|