- 在线时间
- 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")) 5 R" {( }' @/ I# r% [& C& T( y, w
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
/ \4 ]6 F9 Y6 u. CEnd Sub < >'***********************************************************
& S4 @1 Y0 p( g'* PrintDatabaseInfo
2 Y9 `: R# e3 g, S5 u8 f'*********************************************************** 5 w% I3 N) S: V6 g$ K# f8 F. u
Private Sub PrintDatabaseInfo(byval DivSetNo)
, g7 O1 j4 R, [ dim tbl : u5 f+ x3 d+ g7 E
tbl = MakeTable(dbg_DB_Data)
8 S- P, G& ?6 L+ h3 _3 l tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
- v- K+ c6 X( C; A8 {6 Z( f Response.Write replace(tbl,"|", vbcrlf)
% R1 \: O! L& ~* S* Y) ] MEnd Sub </P>< >'*********************************************************** 3 ]% j4 ^9 B2 |9 D4 l( `
'* PrintCollection 9 Z9 Q s7 l7 L1 V; G. Y3 ]
'***********************************************************
2 X2 G P$ M/ ]8 [5 p% h( t1 F+ EPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) % c/ ~9 F ^' n! l' W/ U+ O
Dim vItem, tbl, Temp
$ {6 |# |2 i: @( b( S: i For Each vItem In Collection
. D" m4 @* c9 ?! H) y. r if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then $ I% b* A0 C5 |- Z j
tbl = AddRow(tbl, vItem, "{object}") % w& Y( f7 _0 M, U3 S
elseif isnull(Collection(vItem)) then 9 c8 ^3 m: t- Z& |. x( Q0 T7 N4 @
tbl = AddRow(tbl, vItem, "{null}") + q2 y( x' n; R! `, G+ H, X
elseif isarray(Collection(vItem)) then ' [; e! x; _6 W5 p P
tbl = AddRow(tbl, vItem, "{array}") # l: s6 x) V* [5 R, \8 d& X. ^8 i
else
# ^% C4 u1 Y( _8 d if dbg_AllVars then $ X) S' E6 C% j+ B( V3 y, k6 U
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 0 L6 \# V% r5 Z5 ?2 _. }
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 4 Q* M% [/ r' w
if Collection(vItem) <> "" then
. R6 }$ d* S0 D: O( p) z/ p tbl = AddRow(tbl, vItem, server.HTML1 M, H0 H9 l3 g! e* m: o( q
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
* Q6 {, v9 G2 Y: m9 ~ else
% X" i1 v% k6 X) h tbl = AddRow(tbl, vItem, "...") # Q- N7 p& ~# }6 E
end if
$ D& }# Z. K D' @9 t" s ? end if
( v4 w% Q. I% u! B end if ! u$ N+ w& L3 [1 ^' i3 ]) d0 ^
Next
- d8 z1 c; g, P1 \% g% y) e, ] if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo - o4 m6 t9 C6 Q) u
tbl = MakeTable(tbl)
% y% i/ u. `) @9 C' [9 Y if Collection.count <= 0 then DivSetNo =2
* _$ E+ r! J& A6 L6 q$ E' w tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
7 {3 S U: q8 V5 }/ g# z tbl = replace(tbl,"#sectname#",replace(Name," ","")) 0 g5 j4 s( G7 d" r
Response.Write replace(tbl,"|", vbcrlf)
8 @5 g4 N8 Z1 o5 x7 m$ GEnd Sub
6 P- q+ S7 @5 N4 M+ G
a- \- \: N5 t2 m ]' U2 I'*********************************************************** " P4 K. J, U, W% Y3 D# |/ ?7 i9 ]. ]
'* AddRow ' I: ~. G! V& ]# E0 I
'***********************************************************
: g8 K, x' o3 ?4 _, S# cPrivate Function AddRow(byval t, byval var, byval val)
; b$ e, x8 b8 n; N v$ U t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
5 ~* c4 S, E. Z3 t& Y" b# y, s AddRow = t
, U1 _# O$ _8 B' \% Z& U0 @End Function </P>< >'*********************************************************** 7 a$ g3 t. F+ w2 | l# Y
'* MakeTable 1 ^! @! M; ]2 b
'*********************************************************** * v3 y* j3 B/ S9 e2 d. y7 z6 l
Private Function MakeTable(byval tdata)
& K2 m% o8 O3 V2 f" D tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
4 |0 I( P( w1 \0 q$ D2 Z J7 Y MakeTable = tdata
6 Q+ G7 r$ p9 VEnd Function </P>< >'***********************************************************
; I7 n; L7 h" h2 z; h''@SDESCRIPTION: Draws the Debug-panel
& v- v" k& ~. F: m; [7 ^% l! ]'***********************************************************
) _* A8 I; @) [$ J1 H9 _; W* pPublic Sub draw()
9 m( z4 g" h) p4 I- N/ J7 F If dbg_Enabled Then 6 R, M$ [. n; I: V- B' _0 t
dbg_FinishTime = Now()
4 U' r ?/ b- T* G 0 g+ ]( H) j4 ^8 S5 M7 q
Dim DivSet, x
- @3 e. h* v8 N# _# k DivSet = split(dbg_Show_default,",") + E/ g+ E5 T! N$ |' g
dbg_Show = split(dbg_Show,",") ' K! W" v6 `1 ^
8 f: }+ c& A2 j$ B5 B For x = 0 to ubound(dbg_Show)
|2 g( z: E$ I4 b, \ divSet(x) = dbg_Show(x) : K& k& ^2 u c2 X
Next
/ c/ ~4 q- G, J: D4 z
1 ?3 _2 v3 l: _8 _; L, C! q 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>" : ]9 c6 U8 A+ \6 c
Call PrintSummaryInfo(divSet(0)) * P) W$ h8 h) J5 ~8 Q
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 7 P0 `) {( j0 q
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 6 A$ J/ w, J( e# J- I
Call PrintCollection("FORM", Request.Form(),divSet(3),"") 8 f, a* V% p9 v/ V4 y2 Q( @* t' w
Call PrintCookiesInfo(divSet(4))
9 E4 i1 z; m: f. U4 W! v. h& f1 w' V" u1 g4 \ 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)) $ g- f. ?5 N" `
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") y2 P4 o. M# z u5 C
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 6 n' N3 E6 R K- ]( t
Call PrintDatabaseInfo(divSet(8)) 9 j9 m ?2 u+ m* Y% ]
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
2 l2 p4 ], x7 R$ l- w, M; a Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") " {7 j- o Q3 G( a$ J5 j
Response.Write "</Table>" 4 h2 m( W5 y, f; {, b' n
End If $ {4 k1 V$ H( O
End Sub </P>< >'Destructor
- e% ~& P# E0 {; x* u5 d; fPrivate Sub Class_Terminate()
2 U* n( y" p2 m# y% A H% @ Set dbg_Data = Nothing 9 b- z5 A- |' i0 ~- n) n8 z+ t
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
. t0 x- ~6 k' nCLASS debuggingConsole
3 r% _% u# G, e$ Y) I/ GVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false # ^0 B* [) Z) m- Y7 h m7 \; o
&n
) M V( [- y1 n8 k8 W/ t1 Zbsp;
q: u- B7 N' _4 {6 F- eProperty Get Enabled===[bool] Gets the "enabled" value ' W* P4 L$ i% ?* y
5 @9 Q* \* V3 p( N1 ~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
; ~! \1 f2 Y* I7 O ' Z6 S7 y1 P' A: v; O
Property Get Show===[string] Gets the debugging panel.
; J; K' p+ Y" f0 ]5 H 7 _) S6 U/ M0 S" f3 L* G
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>< >-------------------------------------------------------------------------------- # d$ _5 Y- G! {, |
Public Methods </P>< >public sub===Print (label, output)
8 Q8 F1 b6 L. _' i$ ~5 X3 Z Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) ; n- f; R4 B1 N1 N" ]% [
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () . r& ]" x1 \" c5 V
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
4 N2 j8 F( q0 Q! ~% b' l& O( a; oMethods Detail
7 F. t$ e; j9 Y- G6 Q0 T0 |
A4 t9 g; v) I2 Q- hpublic sub===Print (label, output)
1 l8 D) C% t/ _6 e; Q/ f# \Parameters: ) _' u7 |* Z Y$ I( c- v
- label [string]: Description of the variable ; K9 H3 h4 ~& o/ S, |# |; }: j
- output [variable]: The variable itself 6 ^: g9 H" Q5 {7 X7 ~) V+ r( c
% ]6 ]# Y+ H8 s- V( } hpublic sub===GrabDatabaseInfo (byval oSQLDB)
/ y, _, h8 \$ l8 AParameters:
2 G, j5 D- L# z2 h$ {) K' u3 G - oSQLDB [object]: connection-object</P> |
|