- 在线时间
- 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")) & ]& s" [% ~, j
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) ( `0 w2 f+ ]4 @0 Z/ o
End Sub < >'***********************************************************
, K2 g- h% E9 D3 a'* PrintDatabaseInfo ' v9 {( N: @4 K2 n/ ?
'*********************************************************** + ^! B7 q; V4 W% n
Private Sub PrintDatabaseInfo(byval DivSetNo) - P* s# d q+ b
dim tbl 5 q, I. y5 K/ I4 f* u( I- N
tbl = MakeTable(dbg_DB_Data) 6 {$ {! P* r) K* Z
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ' Q: c2 G; e* W" C1 u1 U- f
Response.Write replace(tbl,"|", vbcrlf) , I! V, j8 i2 w) z1 Q# m. k
End Sub </P>< >'*********************************************************** 4 t# v( M# V3 `$ z
'* PrintCollection - k& h8 J: }) Y8 n0 J& ^$ a
'***********************************************************
' m9 e$ H! K# j6 a" G$ uPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 4 t$ j) o" E) x0 }1 f
Dim vItem, tbl, Temp 2 h J2 {. r+ h
For Each vItem In Collection 1 I- Z- e+ e+ `
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
* H) l+ i* N5 w3 u7 M: M& \+ P tbl = AddRow(tbl, vItem, "{object}")
( {% n# f' ]* H$ E0 R B elseif isnull(Collection(vItem)) then
4 a" a& Z$ u Q( C# E" @ tbl = AddRow(tbl, vItem, "{null}") & a Z: R/ ~ O) y
elseif isarray(Collection(vItem)) then
! {1 g _6 V) o5 U tbl = AddRow(tbl, vItem, "{array}")
0 W1 c) L9 y' h5 p else / q' \" L9 C0 p9 o5 H! A. p
if dbg_AllVars then 8 \5 I* ^4 M5 S
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
1 Q4 |( V. U* v/ {1 u elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then ! K8 c( ]' F5 k
if Collection(vItem) <> "" then # i7 B5 J) e1 o/ ]; J2 o
tbl = AddRow(tbl, vItem, server.HTML
: K S9 x5 q) o( l0 B4 _: o. pEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
9 f) Q9 S/ E0 b8 K; l else
7 d. n, y6 d6 V# N" F tbl = AddRow(tbl, vItem, "...") / T* }( Z( z* s, r6 ]
end if
4 b$ C. P/ h$ G end if + a# s9 ], B4 w8 {
end if - r4 g$ C; \6 y2 ^: u3 y
Next
i& z5 v' c- h% _% m& | if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
' D T7 P |8 x tbl = MakeTable(tbl) 7 b/ g, R8 m) U; d
if Collection.count <= 0 then DivSetNo =2
; w6 p4 ?3 e$ I0 Y, d7 p( ] tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
$ C, x( t7 m) J& H tbl = replace(tbl,"#sectname#",replace(Name," ",""))
Q) |8 l2 e5 B# _$ ] Response.Write replace(tbl,"|", vbcrlf) _9 x7 ?. b8 r/ n. X2 s
End Sub 6 D5 y( O# ]3 a2 ^- R0 Q
2 V/ `: }5 S+ s, W" f0 K'***********************************************************
3 x; `& V9 v7 B% n r. c'* AddRow
# ?/ q$ N: V( W' ]" m( f6 u'*********************************************************** 9 B4 H# _; a2 F( S! N5 v! X
Private Function AddRow(byval t, byval var, byval val) : ~$ P1 o5 r3 T5 P. D# H. S9 j
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" ! c$ [3 u5 f. u$ F' q; |
AddRow = t 0 f2 K% r3 m7 F
End Function </P>< >'***********************************************************
* Y: k, j/ X: F7 y) R+ Q8 L+ Y'* MakeTable
, ^) s, S0 N2 X* U* R'***********************************************************
% d$ ? z% M% H! x6 d+ ~ C8 SPrivate Function MakeTable(byval tdata) # n/ j0 T- V4 V8 S6 k( g! y
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 1 a2 M; O$ q1 C" \( r- y
MakeTable = tdata
: u8 P1 b' `* x2 V; K9 P/ |End Function </P>< >'***********************************************************
( l4 B' ]4 C1 Z' o''@SDESCRIPTION: Draws the Debug-panel 7 g& i, x9 d* l. d- t
'***********************************************************
9 x& P3 C+ y) ?. i# A7 Y0 j( tPublic Sub draw() ~3 l; k1 t9 b' o% p _ [
If dbg_Enabled Then # m* n" s6 n) R& `; x% g+ _
dbg_FinishTime = Now() 1 Q2 K+ O3 D7 b
5 C1 h& y! x! e0 @! U; ?' w6 U Dim DivSet, x
) i/ n8 ~4 }1 |5 F" R0 I DivSet = split(dbg_Show_default,",")
7 f6 x5 |, V$ x% k' Y7 j dbg_Show = split(dbg_Show,",")
5 P' w' Q5 C5 K$ ~" d2 t# ]
4 z7 c( ~: N, w' @ For x = 0 to ubound(dbg_Show) ; q% j2 J4 q, M' ]2 k% X- w
divSet(x) = dbg_Show(x)
" e4 x$ w# S" v3 @( N; Q4 x Next ; q0 I. `1 O: J, E7 d' @7 F
$ c7 a* K8 E2 n0 Y7 ]/ L8 c 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>" + l1 p( Q* e9 f1 i" V* t
Call PrintSummaryInfo(divSet(0))
, g3 P( Q7 p1 F3 |' I! J4 H; ~ Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") + |; l# y& N, c6 }
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
+ q9 G, d4 G/ X1 ] Call PrintCollection("FORM", Request.Form(),divSet(3),"")
, t, C/ ^) p- c Call PrintCookiesInfo(divSet(4)) , }) ^, x$ R0 j1 P( _+ W
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))
0 P& t9 H9 P9 P5 T; \ Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ; y4 N1 ?2 E1 N+ ]; v2 i2 ^
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) & P0 n. g" g1 t
Call PrintDatabaseInfo(divSet(8))
+ ~6 i) ^4 f: B2 d( @ Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
- d+ y* Z2 k" c* m6 s8 s; N Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") . x7 _9 N. V0 M+ }; H- p
Response.Write "</Table>"
" c: v4 J, e7 ^* `; a. i% l4 ~ End If
" o$ |0 S& W9 r# lEnd Sub </P>< >'Destructor " C7 w+ s1 h5 K8 ~- B" k
Private Sub Class_Terminate() " U$ {3 M# u- z' p
Set dbg_Data = Nothing
* k- e8 M. \% M x4 NEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
# g; ]6 K Y6 o) ]5 h4 ^CLASS debuggingConsole
! g9 b: R- I9 M. n2 s I) JVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 4 V2 Y/ h- ]5 j" P+ q, {
&n
# ^: r+ A" a+ U1 b, j' Bbsp;
" |& X: e" y% |9 i! @7 @Property Get Enabled===[bool] Gets the "enabled" value 4 e5 F$ Q; p1 P s+ m* ^
* a+ U( ?1 G/ L) |. Q/ O2 w5 g
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
% y7 ]' e9 ~( \9 D; @ 6 f' w2 c) a# I( `7 ^ ~( V
Property Get Show===[string] Gets the debugging panel. & d$ m# j- ~, l, V2 E5 i
9 {5 \, Z' G2 n/ m
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>< >--------------------------------------------------------------------------------
) q! K+ B$ _1 H$ E- Y7 c. w8 d3 fPublic Methods </P>< >public sub===Print (label, output)
8 G8 l" @4 n h+ ^3 [1 \ Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 8 F* z, z, ^- T/ _; G* S4 [
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
( d* ^: r2 L( ]0 y+ ~* L Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- / e4 _* @/ B- o
Methods Detail 8 i! @+ l, @: H e# O% @4 t" t
' C- v+ L; w0 _, a; [+ ^( S$ j2 H
public sub===Print (label, output) $ ]1 S* P4 d& E+ i- t3 D
Parameters:
- B3 `% o- Y) w6 `* q U2 v# I6 l9 Q - label [string]: Description of the variable
- ?! A4 d" ^8 O5 {8 o% w - output [variable]: The variable itself
' e3 n' B; A" w4 N
# U' Q. A( d) C; z! Ppublic sub===GrabDatabaseInfo (byval oSQLDB)
& b% y$ s" N* k. s3 I) x: b, N% tParameters: % `* b3 p: l+ A$ [1 V
- oSQLDB [object]: connection-object</P> |
|