- 在线时间
- 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"))
. V: s2 r( [1 n# j dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
1 @; A6 b* a. ]! `# T7 F- q7 `End Sub < >'***********************************************************
- X/ [8 h3 E; F9 j' ^, B# L'* PrintDatabaseInfo
1 W% l& P- E3 r2 c: @$ U'***********************************************************
( L! q5 b6 u2 ~9 }0 K$ bPrivate Sub PrintDatabaseInfo(byval DivSetNo) 9 |$ L2 {. ?, X5 Q! H# F
dim tbl
u7 P/ p2 I/ J s/ V ? tbl = MakeTable(dbg_DB_Data)
4 X4 E) ~( B% b i tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
& n7 d* H7 G! i: I- K2 `+ D Response.Write replace(tbl,"|", vbcrlf)
# }5 | t9 A$ O( s. ^End Sub </P>< >'***********************************************************
6 G1 @' i! c8 R# v$ _'* PrintCollection
4 M7 b3 l- b& G4 ~' V'***********************************************************
# O! `( X& a% W& v2 @Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
s N$ Y2 [1 x ` Dim vItem, tbl, Temp
! \/ _! o7 Z- z6 g# |. o. u" e For Each vItem In Collection
! P( J7 |0 U1 } if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 7 y8 h: r$ `* v: y
tbl = AddRow(tbl, vItem, "{object}")
# t$ I4 i5 b$ V- R- Q elseif isnull(Collection(vItem)) then
5 _! Q8 i4 x! G! [( Y tbl = AddRow(tbl, vItem, "{null}") 5 a; m q9 S+ e7 M5 o, r$ u
elseif isarray(Collection(vItem)) then 2 D% O& b& z8 H
tbl = AddRow(tbl, vItem, "{array}") # k1 G' |! N) c, ]' z# O
else 4 a: n+ h: n( R, c1 j4 J! {
if dbg_AllVars then ; `5 k6 O( q* ^! r2 B
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) # H& q: v+ k& X7 E* g, H
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
" w0 c& N9 F0 O- F if Collection(vItem) <> "" then
3 ?! v0 {; t% u: C3 a7 y tbl = AddRow(tbl, vItem, server.HTML
( O8 Y! {. X4 HEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") " C3 q/ ]( h/ {; i- F$ |8 d
else & @( j* s! t1 [" v
tbl = AddRow(tbl, vItem, "...") + L: d/ \+ w; N% x% ]. v. ]
end if
8 O" J; y: u# r! j8 d; O2 Z) @3 j end if
0 E) O/ B5 h2 j/ K end if 8 e4 j' M3 K! O* f
Next
- A1 @; W2 F S% v" y if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
& v6 {- O' ^! r9 m& M% ^- q9 o tbl = MakeTable(tbl) # Y) F! d+ _( j. w- a. D3 m3 W
if Collection.count <= 0 then DivSetNo =2
- c. n, k: }+ m tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
% c8 n6 Z |" x: F" N0 ?5 i tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ B- \( `1 r9 ~6 X8 m Response.Write replace(tbl,"|", vbcrlf) % K1 ^" m; _. ~; G' o; i
End Sub
1 R9 ?# R# u" P. Z9 x
a+ a, X1 @5 V# ]- v% [; x+ ]) w'*********************************************************** % ~$ }5 P5 S/ r6 B
'* AddRow 3 m1 i7 i) A% Q/ L
'*********************************************************** 4 v# R _ s+ j3 X* m
Private Function AddRow(byval t, byval var, byval val) 7 P$ R# {3 a+ Z# L7 P- v4 \
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" $ R6 a+ L( y7 W8 b! f* L2 R
AddRow = t 1 i/ U; w) ?" I3 G/ h% D8 p
End Function </P>< >'*********************************************************** 0 _3 I9 n/ f1 x, T5 _! `
'* MakeTable
: e1 ~) _/ s4 @'*********************************************************** 5 m! L/ |( k7 Y: Z, S
Private Function MakeTable(byval tdata)
1 ~, W) T# X- V9 r2 [8 O, \1 T tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 3 S. ^$ B/ y% y/ w2 D
MakeTable = tdata 6 v$ k1 P/ U3 C8 n/ p- ^
End Function </P>< >'***********************************************************
y2 E5 k# Z; e0 r''@SDESCRIPTION: Draws the Debug-panel
; ~, B( P) A# b& c" g'***********************************************************
& Q! E& t: T' TPublic Sub draw() ! D y" O5 X8 y4 E; \
If dbg_Enabled Then
8 y5 Y* C& f! g- p dbg_FinishTime = Now()
9 K$ i/ Y+ |2 l r5 x2 Q
( O, B% F9 @2 v1 j Dim DivSet, x " S3 L, `* K1 S, M" L4 I2 [: h
DivSet = split(dbg_Show_default,",")
9 c% v% w8 W$ F% w$ \ dbg_Show = split(dbg_Show,",") 4 _: h O* h9 a# U6 `2 F
& W# H# b. L! [0 ~6 g
For x = 0 to ubound(dbg_Show)
" m$ X$ T8 @6 T* V# i" [5 H divSet(x) = dbg_Show(x)
! h1 B R7 i3 B9 H1 l9 A e) \ Next
* x' |" a- s6 L 7 F: U3 r. P; T O+ V/ [$ Q7 \9 j
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>" ; o8 b! w* e9 L6 a) t3 A! V
Call PrintSummaryInfo(divSet(0)) 5 v) B- `* O1 ]( ^7 s
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 8 b; X: v( X( S1 x& o
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
5 j' `, j# m' e% x$ S. ~ Call PrintCollection("FORM", Request.Form(),divSet(3),"")
, U, G, L. v1 H i/ |. O) | Call PrintCookiesInfo(divSet(4))
b+ D% x2 Q! h1 l8 ]0 M 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)) . h1 P) {# t, v. C2 p
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 8 n! D6 Y- c; ~) ?2 v
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 0 M3 {5 R+ f4 _7 x/ s7 N
Call PrintDatabaseInfo(divSet(8))
" _. Q5 _$ `4 a$ |8 A Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
3 r" }% w$ z! ^! i* i, f Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
, L6 k: a- [- ~ Response.Write "</Table>"
( f- p: ?" `' m End If
0 Q k2 U2 }& I! k4 z' AEnd Sub </P>< >'Destructor
4 V$ c" ^! \! ?+ h4 RPrivate Sub Class_Terminate() " J7 N! \5 K: c
Set dbg_Data = Nothing
. l( }: m& p+ A! a; F! q8 ]End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
" T& g% y) l/ ~: b2 {' c3 }/ MCLASS debuggingConsole
3 f( L6 H' O/ \, c" [Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false ; }4 M' y+ {$ j1 }: T- Q
&n2 a( }# h+ d$ K7 Z
bsp; 0 M* [" e# N9 S" }+ U" ^
Property Get Enabled===[bool] Gets the "enabled" value 8 d$ r0 L1 g2 E+ z+ B
- M% j- r7 j$ i5 r7 {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
) X' f% l8 ^/ N' v8 b2 K; B$ ~ 6 @. ` M x+ ^ A0 U
Property Get Show===[string] Gets the debugging panel. 7 Y4 c% `+ O- ^/ l: u
1 @8 g0 a" Z4 G, d9 j. ]& z
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>< >-------------------------------------------------------------------------------- 3 i0 N5 a! M8 P( I4 D F' z
Public Methods </P>< >public sub===Print (label, output) ' W7 {* `( T* w8 K
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) - q, g; k% R; D4 K
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
& \% p3 v5 t6 T, k8 D% o& n Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 4 g% ?$ E$ ~9 z/ Q! n
Methods Detail
" @: C" K, P9 q* ~6 z$ u* G
/ F5 N5 t% U: u3 Fpublic sub===Print (label, output) / t/ b& {* u3 R0 d5 C- g
Parameters:
9 B" C2 v, y" D" v1 o - label [string]: Description of the variable
: ]" V( H. | G- R q - output [variable]: The variable itself . C* g0 Y& B) v5 `8 ?1 Z! r
. x9 I' r& i/ x5 r) h; kpublic sub===GrabDatabaseInfo (byval oSQLDB) 1 |4 z$ F1 d- Y* w/ ?. w1 e6 N
Parameters: 6 e& d( O" E. H p
- oSQLDB [object]: connection-object</P> |
|