- 在线时间
- 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"))
' y, f& J" H" H1 | i/ D, E dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
' v) M; \- {) q9 s) UEnd Sub < >'*********************************************************** 0 [% {* ^1 l5 h; d
'* PrintDatabaseInfo + q. u" U' u# o' C# c# ]
'*********************************************************** 0 \5 ^3 z$ f- v; I
Private Sub PrintDatabaseInfo(byval DivSetNo)
2 a' u# W. J0 v, i0 C0 F6 ^& G: q$ O0 ? dim tbl 7 o3 X i: j# f, B2 P9 F* i
tbl = MakeTable(dbg_DB_Data) ) ]. p% G k* L* @8 s( J7 }' {
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
9 [' M! ^; R+ y" C Response.Write replace(tbl,"|", vbcrlf)
3 s Q+ }% v, EEnd Sub </P>< >'***********************************************************
+ D3 }) w' v9 W" Y! b& k" Z'* PrintCollection
8 t! N/ X1 z) u'***********************************************************
. B+ l% f$ T4 s: L- S9 DPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
5 s( W. u. C$ v& R0 i Dim vItem, tbl, Temp : f. H4 o+ c$ ~2 r
For Each vItem In Collection
6 f! a4 \. D; P. q* l6 \9 x6 A if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
( V& x) z1 U+ V$ I7 |$ A tbl = AddRow(tbl, vItem, "{object}") - m+ z' c7 f7 _; |2 C
elseif isnull(Collection(vItem)) then
( g1 z7 ^6 a; {, m3 m7 }7 R/ s1 T tbl = AddRow(tbl, vItem, "{null}")
. h+ @$ r. M" O# R4 E+ t elseif isarray(Collection(vItem)) then : P1 d: D8 t- i- Q; ?8 q: I8 M. C
tbl = AddRow(tbl, vItem, "{array}") - D% y, D2 [8 \8 D6 v
else 0 h1 f. @6 P& o* ]
if dbg_AllVars then . Y, o0 o, m# }) ?+ ^2 z6 R
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) : m9 d- t; R4 D) A2 Y- R
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
% m J& t! a6 P! }3 s9 U if Collection(vItem) <> "" then " O* Q$ }7 D4 f+ c
tbl = AddRow(tbl, vItem, server.HTML
! m2 o$ F" @/ p! |; FEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") * g0 A% O+ j8 }0 Q' t; I. f
else ( j& l) k5 }' J! Q! v
tbl = AddRow(tbl, vItem, "...") 2 A7 _/ e6 X! t1 K
end if
6 k4 F, F; M% m& ^7 C; Z end if
; L/ Z7 |$ r# ?$ H/ L: S- r. V end if
; i5 [( b" [3 R# c; a2 K Next j! F: w* ~2 O: e# [
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 0 o# k0 k l/ w9 n" }: v
tbl = MakeTable(tbl) * z! h; l$ q2 W- l. N
if Collection.count <= 0 then DivSetNo =2 ! g3 T2 ~9 V& O! M. l. Y1 m+ Z' U
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) + Z% Y/ ^5 u/ w, k7 g/ G
tbl = replace(tbl,"#sectname#",replace(Name," ","")) $ n$ ~- t$ t4 Y+ R% W
Response.Write replace(tbl,"|", vbcrlf) 0 |2 g& z+ ?* K, d: c: C8 w# A
End Sub ! E6 R. k+ y# ~' L" n
9 }0 b6 i$ D( b
'*********************************************************** ( R$ r6 D2 Q9 y
'* AddRow
; A& ?- h* r, v'*********************************************************** 1 h) h2 \* K- Z6 B$ V
Private Function AddRow(byval t, byval var, byval val) % s! {3 v* k; @
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 5 a$ Q9 j6 t d9 ~, q6 N
AddRow = t
- M8 t; a" A MEnd Function </P>< >'***********************************************************
+ d. z2 z2 h+ s$ W$ y/ E5 Y* u'* MakeTable
; k) V! F# J, |+ q7 H'***********************************************************
5 u1 g/ X& K/ _0 `" IPrivate Function MakeTable(byval tdata)
2 f" ^- P* t( |7 z/ K7 N7 A% O2 z tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" : J4 o! c0 _% C1 P
MakeTable = tdata 5 ~# `1 }; t/ A$ @% j) r4 F x
End Function </P>< >'*********************************************************** # N5 H2 i3 d$ I6 C$ ~' l
''@SDESCRIPTION: Draws the Debug-panel
. L, m1 D/ m7 u# t; g5 h'***********************************************************
7 l4 b$ {$ r6 g6 N7 e# }0 X$ RPublic Sub draw() ( f& y, ?* R1 Z4 S
If dbg_Enabled Then + l$ D7 h, l; V; |* K# S
dbg_FinishTime = Now()
4 f2 n6 x- |& ~; Q o6 Q# Y
3 W) B( ]* ^; U6 \- A* H8 A Dim DivSet, x b. Z c& } A7 F* X% P( v, q+ U
DivSet = split(dbg_Show_default,",")
& r2 H% P0 s: e dbg_Show = split(dbg_Show,",") * U% C4 r! O6 P: ?* @+ H t
1 A# P5 ?' r( p) ^: J4 [ For x = 0 to ubound(dbg_Show) - F& e+ E- ^6 ]" \, T" T! [; k
divSet(x) = dbg_Show(x)
. A1 ]$ s% p: n) x4 _. u# e Next
; m( g! \; B: y( w( J1 J $ Y3 `* M/ d3 L6 @ w' U
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 u6 x) y! b. `' ?+ N: V2 ?; M Call PrintSummaryInfo(divSet(0))
2 o1 o9 N1 E& j0 l$ R* d2 T: y Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 1 q, |. ^6 q- R* |4 Q
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
0 Z0 v4 {- L( V( ?$ C1 @( j# o Call PrintCollection("FORM", Request.Form(),divSet(3),"") : |$ S% m! A- G( N
Call PrintCookiesInfo(divSet(4))
# x. f% D1 z) h( i 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, x+ ^! W, J5 r Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 1 U% E& v4 X- }+ P' F% F
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ( ]# ~: t2 K4 B" m$ T0 {
Call PrintDatabaseInfo(divSet(8)) 4 o3 p) T2 T6 O; g
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") $ P6 F+ `& U# N5 d& g
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
1 d- [1 _8 W- e, @7 v( [3 |* E! C. O! h Response.Write "</Table>"
* r) j: |/ \4 L' o7 r' D End If
4 M/ g/ h( k, Y! p/ `End Sub </P>< >'Destructor
5 Z, Q8 Q$ L4 b- \3 l- LPrivate Sub Class_Terminate() * b8 C' r% V, t. z
Set dbg_Data = Nothing 5 Z7 X4 x/ g$ S8 ~( d) R
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >9 P1 w+ b( a# u2 K5 t
CLASS debuggingConsole
6 E& q9 a2 O9 ?3 I% R8 d# GVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false n; F0 ?+ p n5 E. q1 }
&n
+ [- {8 @ V& W% O$ T: S D+ cbsp;
$ _; K3 G& [- a2 b9 YProperty Get Enabled===[bool] Gets the "enabled" value & D3 g0 x! w7 f/ {+ i
4 ~7 |8 X# I- U+ i" Y
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
8 \) A0 r4 i# s) ~4 }9 L$ z . e; q# Q" u: }% {" o& L
Property Get Show===[string] Gets the debugging panel.
4 a$ }0 Y; c6 `( T: s8 ^
- P/ b+ w# q& W2 l2 a5 ~7 ^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>< >-------------------------------------------------------------------------------- # U9 s8 e! D1 s/ ^$ G$ G
Public Methods </P>< >public sub===Print (label, output)
7 ^' y- m! R! {0 A Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
, ^ z5 a. K* e Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () ( D9 B3 @! M5 y9 o# s0 [
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- / u% l' I* g- o$ M3 K: Y
Methods Detail
; f4 y/ |; v3 L. B" c! b( v* N0 L
6 A1 |/ s x2 j# O/ H, T' e! y' D! qpublic sub===Print (label, output)
- n" e& j) r+ v5 z0 AParameters:
" x! Y* F* I- K - label [string]: Description of the variable
' f2 }1 e" I! r( S- d! R3 J - output [variable]: The variable itself
) L- z" G( W# I( s2 F1 b6 J - P# k$ |0 Z. D3 Y$ B) Q
public sub===GrabDatabaseInfo (byval oSQLDB) / ^$ O: O5 W6 w1 i, B1 J* v$ r
Parameters:
, O# e3 g, t( O+ q' | - oSQLDB [object]: connection-object</P> |
|