- 在线时间
- 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"))
J# p* ]' i" _$ l: U dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
; H! {2 r/ C. ]0 ]% Q4 v! nEnd Sub < >'*********************************************************** 3 R) I# R+ ^3 m& ^1 ^3 g! g
'* PrintDatabaseInfo
) c; e$ \) L* q" D'*********************************************************** 8 G7 g! Z3 v% B- l. m
Private Sub PrintDatabaseInfo(byval DivSetNo) _% o, a% T. {' ?7 [1 p+ D
dim tbl
# _, `0 q7 t$ f3 ^/ O2 K! ]+ Q tbl = MakeTable(dbg_DB_Data)
) y g0 Z! q; r7 z3 }& b tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
' x8 o, ]& _" G Response.Write replace(tbl,"|", vbcrlf)
: S; p* ~1 C, K7 Y) b! mEnd Sub </P>< >'***********************************************************
. G- y6 X( B. v' h, k'* PrintCollection # d0 d5 @! M+ M j
'***********************************************************
9 _3 i, i" ]7 d" P8 x- CPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
& V8 n/ r) q4 p* d Dim vItem, tbl, Temp 5 n) j) U1 E8 Q7 M: J0 g
For Each vItem In Collection
5 p7 m+ z1 }' d* h if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then & h% ?$ o- C- K. f1 V: d# w2 ?3 j, a
tbl = AddRow(tbl, vItem, "{object}")
( T! Z0 k9 @# z elseif isnull(Collection(vItem)) then ' `# m" Q- u8 ~+ I) s
tbl = AddRow(tbl, vItem, "{null}")
* O, T$ H" Y& m' N elseif isarray(Collection(vItem)) then
2 A8 u/ i/ }$ i tbl = AddRow(tbl, vItem, "{array}")
4 `+ W6 N# M! s) k else , t$ ?5 S8 s0 u. H1 O
if dbg_AllVars then i" B9 ~ z k4 k9 u
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) & E/ R0 @, q! x/ l' R
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then # l9 k: E3 U5 B. G; w6 R& g
if Collection(vItem) <> "" then
# g# P# v4 ~0 _6 R' `+ D3 I) E$ G0 |) A: Q tbl = AddRow(tbl, vItem, server.HTML
! @* {$ ], H# \" K3 Z+ JEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 1 q: w* _. {7 s4 u' i% b
else
$ b0 B% _( X$ @5 r* ]$ b( y tbl = AddRow(tbl, vItem, "...")
/ I2 [/ |: M6 \4 Z5 w2 p$ g' j% O) | end if 7 z- T' g4 d" c+ y2 W
end if 9 i! B9 U3 u2 ~' g+ q0 m
end if 6 W' F% f$ ?' z$ `( D3 a
Next * ?2 q& Y( E+ L, c ~* R$ [) f6 Z
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo ; h. p7 u. O" V; Z
tbl = MakeTable(tbl)
6 k. L4 L9 N/ @5 H4 b if Collection.count <= 0 then DivSetNo =2 9 u( @; r8 p0 E# K
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
; Y! D5 p) N" G- V tbl = replace(tbl,"#sectname#",replace(Name," ","")) , v- Y- D& c0 k5 B9 ^3 S4 L$ h6 m
Response.Write replace(tbl,"|", vbcrlf)
; h3 l/ |) N" Y0 B# X4 tEnd Sub
2 O9 Y' ^4 x% b p 8 B% l& K1 g: t% S- z( ?7 V
'***********************************************************
8 p: m$ O( g" t6 A' u3 J) _1 V8 ['* AddRow
S! i( G6 i# c/ U3 ~; V'*********************************************************** 5 L( s; n# b! d; f) {
Private Function AddRow(byval t, byval var, byval val)
, G, F' V$ J m t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" % O1 D0 h) V9 x7 n' C- J& `
AddRow = t 9 @0 s5 }* S: D9 a$ G, A
End Function </P>< >'***********************************************************
8 r8 ?0 ]* L1 ['* MakeTable ) l4 K- r& Z8 q! Y% g6 r' Y3 M" I
'*********************************************************** % v4 B' {- A% e
Private Function MakeTable(byval tdata)
1 h+ ~/ W5 Q$ O$ t# f0 b7 r tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" ) @* k. j5 ]6 [4 h- X
MakeTable = tdata
" u4 {2 N: D- Q1 Y: x; AEnd Function </P>< >'*********************************************************** 5 G; {3 F4 }+ w/ n) \1 c8 K0 F( w. T
''@SDESCRIPTION: Draws the Debug-panel
' x( P) N' {+ P'*********************************************************** @2 i0 Q2 H1 G% L
Public Sub draw() / K3 Z6 N$ c L
If dbg_Enabled Then
1 F: F; B9 U6 i* T K" z8 c dbg_FinishTime = Now()
. }3 b2 U- F- R' L" C; A) Y- n
' O. e0 Z! p! m/ w, o5 C Dim DivSet, x " M Z4 Y, U/ J4 V4 D2 @
DivSet = split(dbg_Show_default,",")
' u- o' L1 e0 p: [ dbg_Show = split(dbg_Show,",")
0 K6 E, J/ R* @; g$ E& B
" t0 |; v' B, d; U1 ?: U/ m For x = 0 to ubound(dbg_Show) * r- n0 q7 f: q. [/ e
divSet(x) = dbg_Show(x)
& _( E9 [( P+ O) O Next
2 n! V" q a0 V F$ L " @; H% j( o. v% h4 ^6 S4 w8 Z
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>"
& J# T+ x, w+ @ Call PrintSummaryInfo(divSet(0))
4 x6 p+ W4 _' i- j; S Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* T9 Y% a1 B, r# s# p7 R9 O Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
1 {$ X) `6 ~9 h9 p3 a8 w Call PrintCollection("FORM", Request.Form(),divSet(3),"") 3 B; w, o# B! ? ` _) k
Call PrintCookiesInfo(divSet(4))
* i, y1 N* J6 e/ E2 M# k 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))
, _8 N8 L8 o5 A, e2 H Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") % A ?- [5 w) `. p0 K
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 1 ^/ w9 i# K0 M9 `
Call PrintDatabaseInfo(divSet(8)) : ], {4 _1 o' G9 K, \( ?
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 7 t; Y$ ~0 t1 b% m# r* [3 h
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
0 J, @/ n8 Q2 ? t' C7 ? Response.Write "</Table>"
# V* ?, Q* s; D4 v% c1 q. l8 c" f End If
7 q9 |/ m( \+ Z& Y, s, K; D, o9 tEnd Sub </P>< >'Destructor - Q4 M% V) g* k7 t2 F, P
Private Sub Class_Terminate()
5 M/ U- q) i, F; \& j o5 N; R Set dbg_Data = Nothing ; x1 N) h7 m0 y0 l3 {1 y( B
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
& [; f8 e1 p5 C$ n0 j5 W5 C' RCLASS debuggingConsole ) b' P$ |0 S& S
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false / w5 X9 z) y% z# z6 J, _
&n
) F& _0 c# V3 Cbsp;
) p7 o; q0 y5 _) s9 NProperty Get Enabled===[bool] Gets the "enabled" value 0 ~; \9 K! z4 p0 a4 ~1 ^2 I5 b
8 i3 v6 X9 `. s" \* a% m- l7 }) 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
# B0 |7 Q; ~8 a+ @' J / c" R2 X" F; C T3 V( H3 G
Property Get Show===[string] Gets the debugging panel.
$ V6 \4 F$ q* ~( B0 M+ J
0 |: o+ H6 k# f- {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>< >--------------------------------------------------------------------------------
) K8 M3 X; P2 g b& m% @Public Methods </P>< >public sub===Print (label, output) `# |4 c* [( x s( Q# z a0 J
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
# o2 v7 ~3 x7 p5 }, Q9 k6 I Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
8 x; z' f" E/ y# c Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
9 b. |9 Y% G* \5 n, wMethods Detail
/ G# v4 Z/ l; v
, [" s6 }5 Z9 Z q# v6 \# u apublic sub===Print (label, output)
4 k1 e, i W9 PParameters:
5 v& @9 p8 J8 h) n, u- c3 A- @' M - label [string]: Description of the variable
" q1 C" H) I# @7 T2 x - output [variable]: The variable itself
) m+ P, ?6 W% w" p M" ^: j 3 F' H4 q$ g4 h: Q
public sub===GrabDatabaseInfo (byval oSQLDB) : b, a! Z& y# P f$ y, Q$ @
Parameters: - v- B. g& s( O$ k% r4 G
- oSQLDB [object]: connection-object</P> |
|