- 在线时间
- 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"))
p3 f0 p* J0 s; ]5 Q* g4 u dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) / `: u- a, z8 b2 V2 B
End Sub < >'***********************************************************
" z8 n0 t$ U; s( |) C/ c1 J" i. ~'* PrintDatabaseInfo 4 l# v' e" J5 Q/ T7 w! C
'*********************************************************** / ^+ g; D L7 a. n7 Y E
Private Sub PrintDatabaseInfo(byval DivSetNo)
% \4 [8 ~8 l; t dim tbl
2 g. N6 E# \) k( L+ h# f. | tbl = MakeTable(dbg_DB_Data)
8 p, F7 Y5 h5 w1 f5 x tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) / |' n: F- |% i* o0 U8 q
Response.Write replace(tbl,"|", vbcrlf)
, Y' k/ z* Z+ \End Sub </P>< >'*********************************************************** 2 b U& V, y/ x; A/ p
'* PrintCollection , ]+ }8 d* }/ f; f- b8 i, h
'***********************************************************
- Z: m9 }6 M8 x5 ~, \Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) - } [' l9 }- y ]7 V1 M* \/ h/ L: a
Dim vItem, tbl, Temp * B2 @+ Z h7 r6 I1 S- Y I5 N8 F
For Each vItem In Collection % V. L+ u) c, ~
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
6 l9 Y$ F& A2 V2 ]. h% Y tbl = AddRow(tbl, vItem, "{object}") / d$ T: T' l" f' h/ T" e& m' z
elseif isnull(Collection(vItem)) then 1 x0 e) m* _+ f
tbl = AddRow(tbl, vItem, "{null}")
# S& V4 {# R# E0 {+ { elseif isarray(Collection(vItem)) then
( ~# u; j$ s4 S8 t" j* p tbl = AddRow(tbl, vItem, "{array}")
& m( ~, p3 r# u0 l- ^ else 4 E4 ?/ @, }8 g4 X; E# ]
if dbg_AllVars then
" J3 M N; A0 B5 b7 h. J tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) ! t0 {- F A% i0 c
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then ( R) n, {; L# p- T( P- T
if Collection(vItem) <> "" then . ^$ r% O- L, i
tbl = AddRow(tbl, vItem, server.HTML! E' c! U5 k1 J! }
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
, I+ n6 _. F( Z0 u else - ?8 F; \5 T K0 G- e# J6 v. k+ C4 @
tbl = AddRow(tbl, vItem, "...") & s3 X2 T: X( t/ |, {5 G
end if ! p8 }; b6 ^7 v( G( d
end if 7 E9 Z; W2 |* D0 o- a
end if , u4 l% Z- C) S3 o
Next ; C, ~5 W) V" K- u9 i. s/ ^ r
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
- T4 V7 b6 W. o( C( E8 h O tbl = MakeTable(tbl)
. c# t& y8 u3 p; K! g if Collection.count <= 0 then DivSetNo =2 - N! P, z. N }# E- n' M7 _
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 7 r# {1 ]3 }8 {' G4 M! @$ `+ [
tbl = replace(tbl,"#sectname#",replace(Name," ","")) - d- }3 V0 M. P- J: ?1 [# ^' V
Response.Write replace(tbl,"|", vbcrlf) # A" {" @( T7 `0 y+ A# Z6 n& T1 C
End Sub 8 J& {+ {+ [' v1 \
$ m5 K# V0 _& o+ W9 F. Z- F'***********************************************************
! s/ q9 N5 @% h1 G' h'* AddRow
& ]4 j8 k2 U3 z q, R# T6 e'*********************************************************** . M( S+ _% w1 o% c% j. H- ?) u$ e( p
Private Function AddRow(byval t, byval var, byval val) , _; e7 X9 ?" _+ ]
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" $ i, M7 r! x. f
AddRow = t
% q0 C2 n4 U% ^End Function </P>< >'***********************************************************
2 L1 J% s0 A5 ?) a'* MakeTable : G2 G+ E5 I" J& E2 B' O' T% [
'*********************************************************** 9 d+ t* }. g" a# q2 Q6 s
Private Function MakeTable(byval tdata)
, p4 K. y$ ?# w* F% Z tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
% g* J# I7 \& [2 m MakeTable = tdata 2 p( V- P- k2 r; Y6 p+ `' [: T
End Function </P>< >'***********************************************************
B8 A2 C# X" u4 g- X; H r1 r8 I''@SDESCRIPTION: Draws the Debug-panel 0 h: Y8 |+ S0 N; O. s
'***********************************************************
5 t. L: W: v% r& V8 z* \Public Sub draw() ( C; n4 D) \$ y3 c$ J
If dbg_Enabled Then 2 R) _4 X: u: C4 ~5 z: d% l
dbg_FinishTime = Now() 6 G7 M+ ?, T# P! A# Q9 G
# P! D+ y- j' |. S; E0 s% o$ v
Dim DivSet, x u2 _) { E* S- m# g
DivSet = split(dbg_Show_default,",") 0 s0 q9 ]& _3 x Y; }
dbg_Show = split(dbg_Show,",")
+ P* z) z. q, Q) {3 Y6 w
# K6 [# s5 |. Y3 |" j) q& i9 V For x = 0 to ubound(dbg_Show) - B& ~& Y# T/ V8 \: n, X6 W* t
divSet(x) = dbg_Show(x) 7 W4 e9 a6 F2 a: g- I
Next
- ~& n; ?2 Y6 j9 S& G
8 |9 w0 @+ i: @( P" s 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>" . k! `) o: L, ^2 B3 S; }- X% x
Call PrintSummaryInfo(divSet(0))
t- g; m; T; h; g+ y; y& {# l8 u& \ Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
( `& k3 v! W# N8 U Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 9 p' s" p/ y2 u) E/ Z
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
3 t2 Z( r7 x& T6 O Call PrintCookiesInfo(divSet(4))
7 ?: Z" a( {# _ 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)) ' S+ f' L$ _9 F7 ^" G
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ; v Q2 v" x1 W7 z% L% P
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 6 E* c% f" j- t, q( Q/ U
Call PrintDatabaseInfo(divSet(8)) 7 u7 s# _( t& p1 M) W; v7 `+ ]
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 9 H- m3 [# U) V
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 9 i, \# r2 X) H; P7 [. F1 w- |
Response.Write "</Table>"
$ g; J: n, |5 K& j. a% [ End If / U/ o! G& ?1 }6 c
End Sub </P>< >'Destructor
" x# U7 Z/ x, V' r: BPrivate Sub Class_Terminate() 3 K4 o3 L; k6 x1 G' `3 Q
Set dbg_Data = Nothing
. G" R) h% h4 `+ LEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
& Y$ ^7 _. Z8 X$ QCLASS debuggingConsole
3 V( P) X j$ f8 V& FVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
- e+ H8 H5 t& A3 j+ ~( l&n5 O+ J# y5 \0 y7 o% {
bsp; / @+ T0 m& z) _) f/ l* \4 [' o
Property Get Enabled===[bool] Gets the "enabled" value
: y3 \2 d8 c$ ^, `& m " ~+ `" O+ N) |
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 , Q% Y7 ^. a' X. I% R/ Q8 p2 i. D
. a( t! V8 M8 J, e+ q
Property Get Show===[string] Gets the debugging panel. ; i J6 }- _3 J: T: q
& B9 ]! X# T$ S3 ]7 @9 ]7 b4 T
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 ~" W; ?7 E4 }/ x& M5 @: K1 `Public Methods </P>< >public sub===Print (label, output)
0 y, `8 z% `$ C1 F Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 2 d4 o# z( X+ a. M* i9 [, d
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () Y4 y* m H# K5 l3 V
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- ; U" a! [, w, B! t" p" Z3 [, X
Methods Detail / h' v+ M$ j8 \# H. t ^0 g( P) e
0 j9 X+ h" A: Y/ T) V. Cpublic sub===Print (label, output) 9 J- @, m, [* P, H
Parameters: 0 {2 y; A% a% @+ |
- label [string]: Description of the variable 8 I3 z6 t& |8 c
- output [variable]: The variable itself 9 l) c" c) J# b/ l0 f
3 X0 ]$ [, p1 H5 A# w* F6 jpublic sub===GrabDatabaseInfo (byval oSQLDB)
# K/ A' h: z! k5 e1 g8 oParameters:
7 {0 j& N+ b" v8 T9 P7 q - oSQLDB [object]: connection-object</P> |
|