- 在线时间
- 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")) ' @2 p4 A2 B8 p3 Y
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) # J) S9 V. j2 r7 S5 k
End Sub < >'***********************************************************
2 y/ }* v' x2 h'* PrintDatabaseInfo
+ `4 J5 L2 ~; R/ ^9 o'***********************************************************
$ C0 c9 s3 T, YPrivate Sub PrintDatabaseInfo(byval DivSetNo)
' e" Q2 j! Z5 o4 Y+ M# \ dim tbl $ h9 {. w" b" r% A( M
tbl = MakeTable(dbg_DB_Data)
2 `& g7 O4 q! H8 V& Q: z4 x' P* q p tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
# G1 `& K: r' J i Response.Write replace(tbl,"|", vbcrlf) % X; n9 o8 W* C( Y% K6 |
End Sub </P>< >'***********************************************************
- N4 o" a' W- R# v* p% b'* PrintCollection , a0 ?/ G. C& X) X2 ~' [
'***********************************************************
. ^- n& r! z* b+ f3 YPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
2 g) s9 K" j2 ^ I, i Dim vItem, tbl, Temp % ^" ^1 J: o; a% l- }& K; e
For Each vItem In Collection
( S( x+ l# ~ D if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then / b* B9 C. B1 B
tbl = AddRow(tbl, vItem, "{object}") + S2 I$ t7 W" s4 p( C! j
elseif isnull(Collection(vItem)) then
' \# j" v9 B6 d. |& h( l4 j5 h' G tbl = AddRow(tbl, vItem, "{null}") ( X( _( h6 z# p" B r8 V
elseif isarray(Collection(vItem)) then
K6 B% Y) {5 |8 c7 s tbl = AddRow(tbl, vItem, "{array}")
) G+ I% {; u. D$ S+ Y5 b else
' [ g+ f: N! U6 D8 N7 u5 H4 i; w if dbg_AllVars then
. T: e2 M* y- r$ T& R% I, \4 U* ?4 X tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
1 I$ S7 ~" i0 p% k& X+ x, t elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
- c& R' K& k9 q, e if Collection(vItem) <> "" then
0 s3 G: T# a* m# ^2 ] tbl = AddRow(tbl, vItem, server.HTML
+ L9 y- h$ O) |! ^& h6 VEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") + c& W4 g& W" x5 c4 I. _4 H
else * x: \& ?' I U8 S o; ]
tbl = AddRow(tbl, vItem, "...")
; ~" ~ O' Y: F- K. |. H# b# f end if ' [/ `( w1 R0 }. O8 \
end if
2 U ?, k' `$ C end if
. h9 W1 r3 K3 S Next ' A+ F* t( Q# a
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 6 ?4 N* z" H# w6 I' x
tbl = MakeTable(tbl) : O+ r# H( x0 ~6 I7 a/ p+ |
if Collection.count <= 0 then DivSetNo =2
& P+ s$ Q1 B' a/ \0 g1 G tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
c% ]6 W, U1 a4 K( I tbl = replace(tbl,"#sectname#",replace(Name," ","")) 0 O! V) ~) U0 o5 I8 B/ a# U+ p6 {
Response.Write replace(tbl,"|", vbcrlf)
+ T6 t% l2 F5 J+ J# gEnd Sub 0 ^0 s1 {: ~: s1 H6 [! }- _
* A+ }. H* i# e$ v
'***********************************************************
8 |1 `! l+ k' c; w/ L2 i; \( o'* AddRow 8 E* C8 R/ g2 Q# S2 i6 h2 c: K$ g9 o
'*********************************************************** : J- y2 a+ i5 v* I4 g/ ?
Private Function AddRow(byval t, byval var, byval val)
8 h @+ Z' C! z9 F t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" & b( T7 s! Y& a0 F( X: f& m7 b
AddRow = t , J' E" `' ^* _
End Function </P>< >'***********************************************************
^: W5 W( Q; Y. }1 V% @0 z'* MakeTable
' M2 A* X, P/ \3 k'***********************************************************
0 S: |0 h! n6 ~: ~+ gPrivate Function MakeTable(byval tdata)
7 k8 p- N* |: d' K5 S; R tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" $ v' v4 a B8 g n, p
MakeTable = tdata % d1 ]' G. V a2 \0 ^6 h
End Function </P>< >'***********************************************************
6 i+ h' z8 m$ i5 H3 N% z''@SDESCRIPTION: Draws the Debug-panel
" y$ n7 s0 K( b4 V- Z2 z'***********************************************************
$ u. U% _0 z! r* f" wPublic Sub draw()
8 H1 w; y4 @ ~ If dbg_Enabled Then - s( L- }' o& d2 Z( R
dbg_FinishTime = Now() 9 h2 D' d: K$ G9 y4 w4 P
5 f, `7 l2 Y2 t
Dim DivSet, x
5 o! j; X0 @# t; g DivSet = split(dbg_Show_default,",")
+ Q' A0 t$ ^! s# w6 B& U; E dbg_Show = split(dbg_Show,",") 1 E, j' y1 q9 E: t
# L' K6 _3 a- z2 ]8 Z# e For x = 0 to ubound(dbg_Show) 2 c- W9 a* [& B9 r8 J/ I
divSet(x) = dbg_Show(x) ; a2 m( q" h. j# s @* u/ ?, A
Next x# A# r: Z- @4 ?$ I+ A
- m" P( j% @) z( F: H 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>"
3 h( z, d5 U: c( n Call PrintSummaryInfo(divSet(0))
4 ~8 A; z# v# ? ] A. x7 t& k! h3 L Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 5 z- L% d* i, V$ f5 h
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
( G5 u) [4 y+ J' @" ]1 c" k Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 |0 U! s- {# l5 Q% ] Q Call PrintCookiesInfo(divSet(4)) * N7 h- N: d* c
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)) P+ R3 [1 r% J/ m- G8 D9 t* O
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
5 N( s* {8 S8 i) _; j/ ] Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
* z" U f3 `; s/ C9 e& s Call PrintDatabaseInfo(divSet(8)) ! P" x3 y6 |! |
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") $ ]" ~, M( m5 S1 n6 i
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
) A' ~* z& U9 B" p5 X8 T( @6 S Response.Write "</Table>"
# C4 B6 H8 x1 M8 U6 }8 Z3 A End If K7 m' h$ N3 f6 g$ l% v
End Sub </P>< >'Destructor # f9 S( J! w7 t7 a4 d
Private Sub Class_Terminate()
8 G2 O) r4 W; v! J Set dbg_Data = Nothing
7 D9 g0 ]2 X# q Z! D7 vEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
3 b0 I6 _9 \0 z O& d- Y4 |3 x. kCLASS debuggingConsole , N& d8 n$ _9 W( K, X
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
8 |9 { }' ?! \/ }* ^5 [8 ~% d! v&n
( L" S$ W6 ], N2 Z0 ?bsp;
$ R k5 ]) v0 W5 xProperty Get Enabled===[bool] Gets the "enabled" value
]/ M) S9 [, u# ]& |5 I
* s `$ C3 R6 I4 w0 V) m+ d8 pProperty 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
6 A, u# K+ C+ ]* b* }
- T* z7 P0 ~ QProperty Get Show===[string] Gets the debugging panel.
1 A( N5 s1 F& h% o( U2 H- N 3 x: n/ k1 _1 {- }# G* `0 m: J; k
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>< >-------------------------------------------------------------------------------- 6 B+ W' T0 G$ } n f5 p
Public Methods </P>< >public sub===Print (label, output) * @2 a' Q; }3 }7 B/ j: o1 |- Z
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
, I% a4 n7 R {: \9 }5 W [4 m$ b Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
6 P3 A' f1 D! l5 G* j. Z Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
6 p. h, o6 M1 U/ |7 I C2 B% vMethods Detail
& d7 S% w$ Z- Y9 Y
% n) m5 F0 `2 R6 Y6 O6 lpublic sub===Print (label, output) % n/ S8 ~3 P& V1 e* b) g- i1 v
Parameters: ' j2 x D1 u6 V/ v4 {4 f
- label [string]: Description of the variable ' b: i1 s5 {3 u8 g
- output [variable]: The variable itself
3 W8 l( ]- ?% G0 [ 0 P, I! X& Q. o+ B, B; E' g( y
public sub===GrabDatabaseInfo (byval oSQLDB)
3 R' g" E- p5 f/ v* {7 ?6 K0 o B# ZParameters: * i+ |& ~8 k0 l! x, }0 G3 C
- oSQLDB [object]: connection-object</P> |
|