- 在线时间
- 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 T; h$ a8 c% n! `5 H' v# @: R1 M dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) 2 x5 u H) g, G& \
End Sub < >'***********************************************************
* |' Y; @2 n. K e" g, a9 V0 G: ^ W+ ~'* PrintDatabaseInfo
% N' {, V% [; C" O'*********************************************************** . t7 ~% p, p1 v/ y
Private Sub PrintDatabaseInfo(byval DivSetNo) 2 J4 ~5 H* I* S4 l2 p3 v
dim tbl 0 { p* ]8 n+ d4 H4 Q3 \1 ^
tbl = MakeTable(dbg_DB_Data) 1 s$ y3 L# |, L+ [; C5 y. c
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
5 _, X0 w% e9 _4 e4 l5 P! K4 e' J Response.Write replace(tbl,"|", vbcrlf)
3 t9 j7 }+ ]3 X iEnd Sub </P>< >'*********************************************************** 1 m* f7 T+ {" b9 ?
'* PrintCollection 6 ~; T3 P0 q, F1 L+ ^) u4 P8 E1 c
'***********************************************************
N+ D) V# b" t) ]0 GPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 5 \0 ]- C! v7 E
Dim vItem, tbl, Temp
9 i2 k- u8 K; g1 G( l. R For Each vItem In Collection
8 H' ^9 M& x! N1 \( V% k7 K if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
8 A2 s9 O( u3 C. K/ I& s% p3 S- z1 N tbl = AddRow(tbl, vItem, "{object}") 0 R( h9 k: A% R- ^. L) p5 O
elseif isnull(Collection(vItem)) then " s2 E" f; ]' B- \6 ^+ L0 J- N
tbl = AddRow(tbl, vItem, "{null}") * A3 f& i( J4 `" x5 y0 H/ h; M. G
elseif isarray(Collection(vItem)) then
6 K2 {# K1 f9 q tbl = AddRow(tbl, vItem, "{array}") 3 k. F: n" @+ W' e4 u5 P
else
1 V; b' R7 H: l5 r8 g if dbg_AllVars then
( X* U% k# Q. \, D tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) & b, ~2 n/ t7 l, b
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then ) M2 M/ r6 |2 I l
if Collection(vItem) <> "" then
. z1 r. z8 @& J, ` Y* P: @ tbl = AddRow(tbl, vItem, server.HTML/ {9 ~* N3 V4 C2 j
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
; _: a$ A* o$ V7 T1 c) r9 V else
6 `5 g# s! I+ A2 x9 ~ tbl = AddRow(tbl, vItem, "...")
7 \+ X N3 m; ~; [% m2 ^# i5 N end if & a( f8 E4 i( Q8 `) O
end if / T6 O0 q9 X# r T: |: Q
end if
, B$ P e8 G! |# X0 M- T Next
! R+ J* D6 B }/ n) `0 }0 |9 v if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo . {/ ^& A4 O$ G6 Y$ @: G# y
tbl = MakeTable(tbl) ! s3 O R0 s2 \' F+ l9 S
if Collection.count <= 0 then DivSetNo =2
" H2 b9 i5 l3 l% T: P tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
# W: i5 ^& w, B4 b3 S) J. }( y% @1 ^, i tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ E0 G' F' D/ z7 n; H9 Y Response.Write replace(tbl,"|", vbcrlf) - x8 I( d v, q" l3 N) o
End Sub
# K% c+ h; N$ s8 s, b$ h: I. C $ f% G- ?- y) |8 K
'***********************************************************
( V" h" \: @* Z W9 S'* AddRow ( T+ l# f* n% d+ y' n0 H
'***********************************************************
5 d, {4 J- @, F. `9 R2 r' y: `Private Function AddRow(byval t, byval var, byval val) 4 L7 z/ t+ S3 @
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" % q6 c' l+ n W2 P/ t, C6 {1 Y
AddRow = t
: r9 e8 C; M& KEnd Function </P>< >'***********************************************************
& o# r2 q$ A7 E7 i'* MakeTable % P, g6 F \9 i. r% @+ [6 B& A
'***********************************************************
1 M& a0 M) M5 V/ SPrivate Function MakeTable(byval tdata)
4 K X7 w8 O1 M" c9 u tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
* F& _1 h8 `9 k MakeTable = tdata : ?1 m8 V! R! n1 k) T" D
End Function </P>< >'***********************************************************
6 P7 ^0 d ]: q/ F) E''@SDESCRIPTION: Draws the Debug-panel + g* f/ M' f7 ?: i q7 t- I( e& G
'*********************************************************** 1 C& C* X; P$ C! r) [* U- B
Public Sub draw()
& y8 u- j3 V/ p1 P" d% Y If dbg_Enabled Then
4 b! C" }' \4 {) A" n dbg_FinishTime = Now() 3 U, g9 [1 M6 @6 C
. [0 A, U5 g: `* G
Dim DivSet, x
$ Q! _- @6 m1 O" J DivSet = split(dbg_Show_default,",")
6 D5 N" \5 A: e4 M$ _ dbg_Show = split(dbg_Show,",") & U9 i; k3 E3 Z+ o! e( s6 p
) L4 ]! O6 h) r
For x = 0 to ubound(dbg_Show)
/ ~+ Y: E, V& u% @ divSet(x) = dbg_Show(x) 0 R- {, g3 l6 Y9 {/ i& O
Next + P- w) {1 Q; p; Y% j$ {' H: d$ D
0 J0 ~0 s0 E v' [/ l1 A 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 I+ Y1 P$ O& _0 F1 R& P# o Call PrintSummaryInfo(divSet(0)) . i" V0 t+ k4 I/ U0 k+ |
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") " O0 n' r3 t4 s* d
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
+ h0 f7 B2 c7 n# }9 N9 S" Z Call PrintCollection("FORM", Request.Form(),divSet(3),"") ' y- X: ]# e8 k
Call PrintCookiesInfo(divSet(4)) . K2 {4 F' C' ? t% P3 C: ]( a5 `
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))
7 _- H% @. |5 v) }6 w8 o Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 0 i1 e3 O2 E+ K
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
5 C3 E! b$ k; {& t Call PrintDatabaseInfo(divSet(8))
1 f! @+ k n: r# x9 a+ \ Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
" M/ A0 Y3 H, J {% Z. E7 q; } Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 0 z# S( w' e8 @: o
Response.Write "</Table>" $ k$ W* ]0 m7 x
End If " I6 S) ^& h+ U8 A( U7 j7 Z$ Q
End Sub </P>< >'Destructor
4 s1 U, x6 M2 w- m0 U3 YPrivate Sub Class_Terminate() 2 i4 Z$ U/ w9 _3 C+ c& }1 ~& I
Set dbg_Data = Nothing 9 s# Q# B' O: Y* c. M
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
y; h* f6 S/ g W0 c+ C' I5 QCLASS debuggingConsole
0 U' G' a* t' ~' aVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false ( h' ^% K1 X$ Y) w5 V7 b, M& h" R
&n2 X9 I: C5 y5 h6 P$ _/ o
bsp; V2 ]/ `2 {1 D' Q6 t4 @. w# F. L& q
Property Get Enabled===[bool] Gets the "enabled" value 5 V% Z2 ]6 f. t4 ^6 P3 c5 d
$ Y' O4 Q0 w% I" U) ~/ aProperty 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
' v% F/ b& S4 ]) i ( Z3 |4 b! {& p+ i% K" f
Property Get Show===[string] Gets the debugging panel. , H# z' r; K- U# a( T2 q
* I2 ~8 Z7 C4 A7 f5 b; c: i' b0 Q
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>< >--------------------------------------------------------------------------------
- {1 f/ J0 T* V: h; m0 TPublic Methods </P>< >public sub===Print (label, output) / ]- j, A O$ w, U- c) c
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) $ _$ |: u) J. E+ J$ z
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
7 h, r7 s: C7 L) l Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- / ^* `9 ~# e. U$ W" j0 f8 E
Methods Detail 1 z! @- I% G6 d) H: q8 G5 A
. v+ l$ J% g$ x, }+ b1 `& q6 R) Cpublic sub===Print (label, output) & D& E5 o- \$ U! B* d/ e$ W
Parameters: / ~0 }. o+ g; n0 j" W% Z
- label [string]: Description of the variable
5 f+ a$ l. V& d - output [variable]: The variable itself 0 u; }5 h [# U& c* c
0 |/ N) h4 m* N3 Mpublic sub===GrabDatabaseInfo (byval oSQLDB) Z. b: @5 B9 f0 A
Parameters: 1 |! s6 A( d) q0 M* \0 L
- oSQLDB [object]: connection-object</P> |
|