- 在线时间
- 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"))
7 x5 o6 u' ?6 r" z. x/ p dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
4 [& f6 p9 n) H9 pEnd Sub < >'***********************************************************
/ C) u+ L! o- F* l'* PrintDatabaseInfo
3 z: U7 Q+ r8 V'***********************************************************
' h I* U. ]( M% o0 g8 P+ `5 R9 ]Private Sub PrintDatabaseInfo(byval DivSetNo) ! ]$ T1 {/ F" G5 \* \
dim tbl
: v8 F. z/ x; F. o- [. i; C tbl = MakeTable(dbg_DB_Data) * Y2 g3 C' f) U
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
* P- n$ l9 O; w, {+ {6 Z. q Response.Write replace(tbl,"|", vbcrlf) 1 {6 G' s4 {0 e/ C* J- i" j$ U
End Sub </P>< >'*********************************************************** , l; g, E8 A, R3 a4 v
'* PrintCollection
5 [, e4 |8 c# [& X- {% ] S" T'*********************************************************** - X. H# |4 x2 f2 w
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
4 N2 l& y% Q, \, F- G6 X9 s Dim vItem, tbl, Temp
2 y8 l, s) U; F; l1 L7 |9 a2 g For Each vItem In Collection
- V+ u& ^- X- N& u# q if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
/ N, w7 c' {' t2 _ tbl = AddRow(tbl, vItem, "{object}") & r! C1 q! G+ {; Q; O
elseif isnull(Collection(vItem)) then
2 Q! j2 u/ h! E% o1 v/ i j tbl = AddRow(tbl, vItem, "{null}")
$ S3 G0 G9 E: l3 q6 O elseif isarray(Collection(vItem)) then
7 B) L' x3 }. [% g7 M6 T9 [ tbl = AddRow(tbl, vItem, "{array}")
$ P6 O' q4 U* K0 ?) q$ H( u else * G" \* K# l5 o' k# T7 q
if dbg_AllVars then ' q. c3 \+ W1 v2 Q* B
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) & K$ a3 c- u0 Y3 ~6 c
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then ! { ^# m4 R4 W) G, O$ Z4 \6 {
if Collection(vItem) <> "" then
% S( d! E4 }3 q1 y tbl = AddRow(tbl, vItem, server.HTML& [6 `5 s1 N# \2 Z) W
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 8 w+ l V' v% ]" ]1 w
else ' q' ^( O4 v% c& I. E
tbl = AddRow(tbl, vItem, "...")
0 L' c' n* _. R, z1 [ end if
+ w" a" i5 X# Z end if
+ Y% y* S7 E% O. c/ s) c! k end if ; z( y+ L6 L3 h, Y' f6 T
Next
) _+ f4 t7 n1 n! W: e if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
4 T2 { ~# z! Z3 f0 m tbl = MakeTable(tbl)
7 n( o/ F3 k* E! {" B$ }! E9 B if Collection.count <= 0 then DivSetNo =2 ( x4 A( T) o8 c+ B; M! u; ^
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
- `. {4 D" K* u2 w tbl = replace(tbl,"#sectname#",replace(Name," ",""))
8 Y' f& e5 V! F2 l- _# M' e Response.Write replace(tbl,"|", vbcrlf) + l, ]5 ]6 h. b: x; S
End Sub - ], T' T4 J) g4 Y: [( F) `. A
D- ]: Z5 k$ f7 _/ I
'***********************************************************
9 { }% h: S9 [7 { x'* AddRow
. J5 O+ A% _0 `( l& Q d+ Z/ L'***********************************************************
% L- H0 t, \/ c) K) _. f3 T& CPrivate Function AddRow(byval t, byval var, byval val)
) L c: S+ f& Z' n# G- W t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
. k5 ~' _' b" d5 ~0 M0 N2 _- E AddRow = t
6 N; t& y* _1 }; gEnd Function </P>< >'*********************************************************** & q9 L# H( v7 B
'* MakeTable
' o* r0 p: g( ]$ O5 S'*********************************************************** / [6 z- X. u: r6 H0 q
Private Function MakeTable(byval tdata)
1 Q& P( x" D8 v# x5 b0 T+ _- S tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" ) A' Q6 m: M# Q0 G
MakeTable = tdata
' t$ I0 f% g& M6 j* t& u7 J$ S( bEnd Function </P>< >'*********************************************************** ( p% G3 Q- x3 {6 g
''@SDESCRIPTION: Draws the Debug-panel
! @) ^( D4 {& Q# v) x$ e'***********************************************************
' z/ g6 R6 L$ w8 Q0 S( oPublic Sub draw() ' {, O8 b; d7 m$ r8 z
If dbg_Enabled Then ~7 x* a* ~- x. j" L: w% `
dbg_FinishTime = Now()
3 Y' I' ]2 Q5 @ * B0 I8 r# `4 u6 u. R6 T
Dim DivSet, x
1 R- W H2 p, w0 K' p: X DivSet = split(dbg_Show_default,",") 1 P z0 N1 k) l. |' n
dbg_Show = split(dbg_Show,",")
$ Y8 W/ {+ A% f8 j9 R& P
" C8 \5 v2 g* W6 k& ?9 K7 b/ i" z For x = 0 to ubound(dbg_Show)
- ]- N8 E+ H4 S G/ a. `7 o7 V divSet(x) = dbg_Show(x)
' g. U, Y0 f/ {3 j0 o, [) c/ e Next
1 R' ~ A/ d# |6 z/ [# p6 W* h / _# r9 o6 b- i# X D% y
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>" ; m3 A5 S4 F$ V0 _0 b) O
Call PrintSummaryInfo(divSet(0))
* f5 c" S9 p4 V. [/ ?+ r! ~- E Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
5 Y8 l8 f7 X, |3 o/ L- t; n Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 9 q8 @& k2 `+ q7 P# N8 L( M$ [
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
, e; C% I$ d, e5 Y# Y8 p Call PrintCookiesInfo(divSet(4))
4 |+ b7 X) D7 o) p; m: _6 K" f% 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)) 4 [: k* t: U* i
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
9 ]& k& V- \/ K9 l7 K$ ^/ N Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) : {% z; [) `1 F! `) Y0 N* ?% B- @
Call PrintDatabaseInfo(divSet(8)) $ U: v+ U3 O: O4 S! p7 x
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 5 }' ^/ u, G) |/ w1 a. m
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 9 l2 O+ U9 }; B
Response.Write "</Table>"
! t/ h( u; u6 r k. Q8 u' I End If - i# a' H) M; o7 y
End Sub </P>< >'Destructor
0 v- m1 H5 `! H+ @) R8 W. v6 VPrivate Sub Class_Terminate() + K& y% r7 n( n; |
Set dbg_Data = Nothing
2 b0 q# W8 ^, H3 {8 W% r& ~End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >' U/ ]/ Q7 O- a: ]
CLASS debuggingConsole ( k1 M0 `- Y4 b' R% C/ X, q
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
! u% j; ^1 x' W+ t, O4 z! R&n
8 L& h; x. E& H% r( E; G7 {bsp;
+ D6 b4 u1 E7 r$ f$ y) ?& bProperty Get Enabled===[bool] Gets the "enabled" value
8 M/ [% |# u9 I9 N; `8 s$ L % _( T. \9 B. k! `; M- f* L
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 * y- Z9 H" h4 v% `3 l( K
" b4 d/ {. A# x e7 ?9 `- ` |6 x: pProperty Get Show===[string] Gets the debugging panel. l2 X/ E; e: |8 P4 i
: Z% ~% Q2 ]! i# P2 F" F2 FProperty 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 w- L- {, O5 O) e
Public Methods </P>< >public sub===Print (label, output) / ^* Q# {( j, c+ H7 e+ C
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
+ @0 n2 j* _, t( ?7 Q* J Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
+ V9 f0 \, `4 m- H' L) w Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- ) Y& @- } i! n+ l' D& k
Methods Detail
. M2 P; S8 l& ]4 {5 E
7 I- S$ U% a6 C3 p% _/ L2 tpublic sub===Print (label, output)
2 b' Y" c- v4 [: R6 iParameters: # Q" k" y7 X+ D- i, G
- label [string]: Description of the variable
: t. `8 p3 w8 S% c2 Z, C - output [variable]: The variable itself - [7 \) f8 w {0 M' B- U& h) ^
! a, G$ W1 U* Q/ W. O' `public sub===GrabDatabaseInfo (byval oSQLDB)
; |3 O& S l5 c! M" m. j' sParameters:
5 o( E! ~# h+ A& M - oSQLDB [object]: connection-object</P> |
|