- 在线时间
- 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"))
' r7 X; r( [# ^# I3 D dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
5 V2 f# f6 t% I$ u6 fEnd Sub < >'*********************************************************** $ e2 \2 l+ U" C
'* PrintDatabaseInfo
" r H- w2 |5 p: I: U'***********************************************************
8 n6 e0 E- b( Z7 m. t- @Private Sub PrintDatabaseInfo(byval DivSetNo)
+ ?# A @4 M* y( R! u dim tbl 0 r4 [: k) K+ C9 _" Y8 j
tbl = MakeTable(dbg_DB_Data)
/ o Z4 U: \3 Z. @: U* }- |+ V tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
; L3 o6 Y: G' k/ j Response.Write replace(tbl,"|", vbcrlf) 0 ?( L, x* c ]) q' y- J- H
End Sub </P>< >'***********************************************************
6 ?/ t3 k5 l/ S! M: ^; t$ I'* PrintCollection
( X! s- P2 c8 Y2 C8 u. K'***********************************************************
% t" e9 m, A! g: {1 }Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ' ]2 ^* g2 I& o, {
Dim vItem, tbl, Temp
, }! x1 S5 y3 [- w" z% R& S* H For Each vItem In Collection
. h1 B2 ~) P, c9 T if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then % h3 ^' n) ?6 w! s& x+ f
tbl = AddRow(tbl, vItem, "{object}") 5 h" h$ ]' s7 _, e! N
elseif isnull(Collection(vItem)) then " X4 V5 [8 J X
tbl = AddRow(tbl, vItem, "{null}") ! d8 `! N) s$ G7 C7 B
elseif isarray(Collection(vItem)) then
! r0 [1 z9 k# m% p9 X! a tbl = AddRow(tbl, vItem, "{array}") ; v7 o& R: [! h8 _ o' C' l9 |! D/ i
else
6 l9 D, v1 ^' c' [ if dbg_AllVars then
5 L5 b& K" h8 `! I tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 2 @3 ~, I, f3 ^9 s3 |3 g
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then , f/ k/ [. T1 t! h
if Collection(vItem) <> "" then
; p, W h+ v! {9 C9 U5 B/ [ tbl = AddRow(tbl, vItem, server.HTML
( d. U( H9 t' }+ `3 B J* XEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") ( d c$ H/ [3 X2 L
else
9 } _: P) {, P0 Y" s$ {) R tbl = AddRow(tbl, vItem, "...")
& N+ O# E% C& m3 ]9 W2 S( M6 x end if
! H5 e8 z0 B4 a( y+ r2 f) ^ end if 5 u, s4 Y& ?$ V; L) G' W- o: p' ]' e; Z
end if . |1 Q( Q" ~7 v* I$ s8 o
Next
) h8 o7 }5 M3 j# c if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo * S0 R, z' y$ S0 k. F+ ~* [
tbl = MakeTable(tbl)
% P0 D0 L5 G; P& T3 ? if Collection.count <= 0 then DivSetNo =2 . I! p; Q6 V( q6 j8 ?5 g
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
% t- u% t3 e, ` E' ~ tbl = replace(tbl,"#sectname#",replace(Name," ","")) ' u: m7 m+ _( o% _8 d$ Q$ z
Response.Write replace(tbl,"|", vbcrlf) ) c7 g9 J9 W$ k& x8 i6 C
End Sub
: ~9 Y3 e2 q6 h t
# R0 e7 z O; g'*********************************************************** % }* L: }3 w4 b+ R1 E) Z
'* AddRow
7 P" ~* U7 y) ^/ k' m+ z'***********************************************************
1 X4 G5 n( L7 OPrivate Function AddRow(byval t, byval var, byval val)
6 P& b' W1 y, z8 f! J% l t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" , W( K; K$ [8 v0 J; }6 T$ v2 P0 m9 {
AddRow = t ! ?) X d/ O6 a! J# D4 J
End Function </P>< >'***********************************************************
" K$ O5 a& c+ J/ N, G7 B'* MakeTable ) b9 G9 ?4 C5 n% s: w# Q
'***********************************************************
o- l$ E+ g7 O+ F+ g! JPrivate Function MakeTable(byval tdata)
' ^ U% }3 U {2 [- E tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" & M# Y0 j0 p. x; l) s/ ]
MakeTable = tdata
2 ]" l& N- L( U' k6 i( tEnd Function </P>< >'***********************************************************
! q+ t( z9 b4 F' u2 g/ ]''@SDESCRIPTION: Draws the Debug-panel
: t0 m6 P2 V: c* H J( e8 M'***********************************************************
+ L% e) G: `4 wPublic Sub draw()
5 W; @+ Z3 {/ a# k4 U If dbg_Enabled Then 8 G, r1 S7 b' | g; k
dbg_FinishTime = Now()
5 a# X+ ]2 N0 E0 j0 F ( P, y& c9 M2 d& t& ~
Dim DivSet, x % M& Q) {& M' g
DivSet = split(dbg_Show_default,",")
7 T, [4 y8 [7 u dbg_Show = split(dbg_Show,",") 7 a9 K. ~0 P3 x% j6 h
% ]# U) X- A3 v" j
For x = 0 to ubound(dbg_Show)
# [' P( y7 ^& x0 `7 L divSet(x) = dbg_Show(x) 6 Q$ F/ ^1 a' i5 Q; k% F3 v
Next
S; o! u) E- I7 t 0 U, }( A5 i; Y! G/ e+ m: f
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>"
5 W, g" a5 Q- M4 w8 D9 [ Call PrintSummaryInfo(divSet(0))
1 a; i' j: N8 @ Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 4 p# P" d9 r( S0 S
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") : c+ h7 a- L% J$ y9 ^1 H- g
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
o, g0 T" e# z' Q: ] Call PrintCookiesInfo(divSet(4)) 9 e( s, M1 m3 y( I/ w8 H
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))
) z8 F! {% e+ |1 i Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ) j5 e( B6 @: I2 C+ S/ B: G6 ?
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ; w: ^$ x* _8 |
Call PrintDatabaseInfo(divSet(8)) 8 G9 M& }4 h5 H8 `) `+ M* P) @
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 8 g2 I* z5 h, w, t
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
6 T9 ]! J6 P; n$ f+ `4 ]5 k Response.Write "</Table>" 0 d5 N2 v5 i; j, d$ x6 [5 f; b
End If / N" I& ^1 k2 z# ^. q5 X
End Sub </P>< >'Destructor ! u: Z- W6 @0 Q& W1 d
Private Sub Class_Terminate() 2 B' R" r0 w' }+ F
Set dbg_Data = Nothing
3 B* s- s4 A/ J$ Q( }. }; QEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
% [( V' G( D: z! JCLASS debuggingConsole
' y0 o4 o$ g q6 R. {$ ?, dVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false / N1 V* l4 q; R! P
&n
8 g# }9 }' e3 Lbsp; % ]+ ?( X5 I& W' }( v2 P" p+ {
Property Get Enabled===[bool] Gets the "enabled" value
: A$ I7 _% x& w ; m" Y* L H; Y' i) H/ S; b
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 `- u$ u3 H8 Z0 K' }: z4 C- l
* G p7 f- S: c
Property Get Show===[string] Gets the debugging panel.
- x0 ]3 o' M: I; a% Q : X3 u8 j2 a0 z, }5 }9 x
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>< >--------------------------------------------------------------------------------
( j2 b, C3 d* U8 C( aPublic Methods </P>< >public sub===Print (label, output) ' e: B* v7 d3 w6 C$ s# m
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
@+ i3 r' |4 g* Z2 h Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
- K: k' H3 `7 f/ r Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 0 Q+ ^' e! S ~5 B+ d1 ^# ~2 ~1 j
Methods Detail ) O6 ^# I" ]% G y! m$ U: Y9 X3 F
3 z! s3 U0 K. Q7 ~. _( @
public sub===Print (label, output)
: g* L4 q& B/ H7 c+ s) m- `Parameters:
. W# x h3 p. [$ O7 m! W - label [string]: Description of the variable S7 r- i8 o/ s, L" I
- output [variable]: The variable itself
0 l$ v& c; o% i6 m& r# W1 _ 9 a1 D; p+ c* k: r7 f! ~
public sub===GrabDatabaseInfo (byval oSQLDB)
$ G2 \! _; C! q2 lParameters:
2 x& N, U$ V7 J. i: j7 \ - oSQLDB [object]: connection-object</P> |
|