- 在线时间
- 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 p) U9 c9 w/ p$ ~% P1 r dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) + T& C1 {# S" t. I) ~+ f
End Sub < >'*********************************************************** - a! w- I2 B9 h# ?
'* PrintDatabaseInfo
+ I- R( C! M9 E, y% Q4 y1 Z5 ^' m'***********************************************************
' ~* f! l) M% R$ ^! ~4 Q) U9 r0 m* dPrivate Sub PrintDatabaseInfo(byval DivSetNo)
; ^) D, o) Q# G9 C dim tbl $ A( ~& k9 V. [4 S+ s. T/ _# `
tbl = MakeTable(dbg_DB_Data) 4 Y' r. b8 ^9 f( N
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 8 y4 P _ I3 R, v
Response.Write replace(tbl,"|", vbcrlf) 1 F1 q0 q5 d4 Y6 J* H- U
End Sub </P>< >'*********************************************************** ' U) J9 O; i( [3 F/ g0 L
'* PrintCollection 0 Z) |9 V6 L/ r2 D
'*********************************************************** " S0 W+ f& W! w3 |; ^# G! }; D- E
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ' H U' T" e! F3 j
Dim vItem, tbl, Temp ! G8 G+ s& [. _9 ?$ @7 _( Z: i# N
For Each vItem In Collection
! P- S- f1 Z* c# V* h: w& B if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
: ~% Q. g! r* Y ? tbl = AddRow(tbl, vItem, "{object}")
. ^* t7 Z& N. k: }/ x elseif isnull(Collection(vItem)) then
' P! K1 @ @0 _ tbl = AddRow(tbl, vItem, "{null}")
( H3 A0 i/ ^8 r7 @- b$ c( b& m elseif isarray(Collection(vItem)) then
) O$ C2 K ?2 ^3 H$ B5 \. ]* z tbl = AddRow(tbl, vItem, "{array}")
" z/ K0 T: u) a7 _0 C( E/ M! t3 K else
. D/ S* }& g; k. d5 w if dbg_AllVars then 4 D8 ~# g1 F, H7 v
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
, [: l# b3 Q) K9 V( q, C6 V6 q elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
% g0 ~6 I' H. d8 J: Q if Collection(vItem) <> "" then ! N2 j$ E( j6 G" N& f& `0 s0 c; d
tbl = AddRow(tbl, vItem, server.HTML; i% x9 p% O- ~
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
* U2 [6 }9 T. M- J6 S$ y else
# N; f1 _; i$ `; N# [% Z tbl = AddRow(tbl, vItem, "...")
+ ]3 n7 V) v- e0 X3 c- i5 ^ end if ( h0 L# G) k0 ~
end if " x, E* a2 r @) @. ~
end if
: h: U" i4 N" m3 c7 }. S6 J$ ^( | Next
& Y- ?- Y+ v1 A0 [$ O0 G" i8 N if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
- P% L- T+ d; D: S" T tbl = MakeTable(tbl)
% j; S3 O$ t& X) c# T1 z if Collection.count <= 0 then DivSetNo =2
5 n2 |3 [' z% O0 L+ q tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) / g4 N" A# z6 R3 \) f
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
" h. `5 m3 g; B9 \0 n' C! _/ K; ^7 C Response.Write replace(tbl,"|", vbcrlf) ' @. e$ x! w; v- j
End Sub
3 j b; O% `0 ]8 |$ ]& ?1 A+ a2 u: r
6 B1 w; Q, i8 q( M; _! b'*********************************************************** 3 ^ w. @2 L& ?4 v2 {/ ~! ]
'* AddRow
/ m2 w9 M" A# n& I, [7 a+ k4 H# {'***********************************************************
/ Q6 M# k3 ^/ V% K) W4 jPrivate Function AddRow(byval t, byval var, byval val)
- v* t8 x8 e0 t$ h) s t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
# x) h# e- \6 m% N7 v0 S% Z T AddRow = t
3 ?) a/ q5 W8 PEnd Function </P>< >'*********************************************************** ' o3 i. K8 N f' k% R: Q* W
'* MakeTable
& Q2 S8 l& D$ J* w- L& x9 n) `'***********************************************************
. }0 c) r$ _5 z) c, m+ z$ B+ ^1 XPrivate Function MakeTable(byval tdata) 3 `. J7 ^& F- H8 u+ O3 \9 g+ D2 ^9 Y
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
7 B. b3 L* c7 c+ a2 c; C1 f MakeTable = tdata
- X: X0 q% F7 {* ^4 m; V, EEnd Function </P>< >'*********************************************************** * a( k+ X* e4 l* u2 |5 e+ J; P. d" e
''@SDESCRIPTION: Draws the Debug-panel / |' t9 y$ S0 z" O, }
'***********************************************************
4 A8 ]; e9 ~8 N; ePublic Sub draw()
2 x, C2 P6 u2 @ If dbg_Enabled Then 2 s+ c7 ^5 K3 I; V
dbg_FinishTime = Now()
[- y! U3 a1 \: G7 ~8 k8 r* h % @+ v0 n0 Q" f7 q$ r
Dim DivSet, x $ c/ T( n3 a C2 L2 w* J6 c+ h
DivSet = split(dbg_Show_default,",")
6 c: f& S9 U# Q5 g1 R dbg_Show = split(dbg_Show,",")
7 d$ Z/ Q* F# s" J& p& Y b0 j
5 A) i5 d$ D) m9 V* u' @0 B For x = 0 to ubound(dbg_Show)
. W' E- y9 e4 P' ~0 U9 @ divSet(x) = dbg_Show(x) 4 b, c" W: I$ N5 C% z
Next
2 m0 e% D2 [+ L1 m/ ?5 G! c
/ z" V8 m- z1 X2 Q6 `" L; l; p 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>" ' _, p" e/ U- b. ]' w- k6 @
Call PrintSummaryInfo(divSet(0)) ( r8 I1 O8 P. s% j- x
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
6 r' }1 O* K8 n# S) O7 y5 J Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 8 D; q& m1 Y u/ \3 q
Call PrintCollection("FORM", Request.Form(),divSet(3),"") ) N+ u1 I$ @" K- U6 U& C- ^0 z
Call PrintCookiesInfo(divSet(4)) & n. Z, u& F8 c: N9 b7 N
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))
: \$ Q" c$ g8 y. J( \+ ]# `7 T Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
" W) z! ?9 v( t2 a9 Z) y Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
% P6 b2 [( t6 Y6 e# w. _7 h Call PrintDatabaseInfo(divSet(8))
+ _7 ~- G* e1 ^ Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 1 b( i5 C+ m( r! R7 x$ Q' C
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") / x/ w, B6 [2 {' b
Response.Write "</Table>" . Q& Z; |; }' K4 s4 g; i
End If
1 A4 C: b: c3 G. M3 ]3 TEnd Sub </P>< >'Destructor + o q; S- R0 d0 T+ y
Private Sub Class_Terminate()
4 {5 X. K" C4 E4 o6 r' a Set dbg_Data = Nothing
# n3 S2 j: h9 L5 cEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
0 F7 _% q+ K6 i) K, ^# PCLASS debuggingConsole
6 C2 U5 h" _( x! e" e0 m1 H0 xVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
/ H$ I$ R- U# M&n/ I( Q' S% k. i$ {4 u. b
bsp; " `3 d8 s" F: T3 y4 D6 G
Property Get Enabled===[bool] Gets the "enabled" value
0 j( U) k1 M# S2 j, t S+ W
' }4 a6 U$ m- y' QProperty 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 / {% K% ]; R& r: z, f* e- I
& L M- B( a+ N- c' B0 j/ h+ g0 fProperty Get Show===[string] Gets the debugging panel.
& F+ d4 N0 Y3 L
1 m% P5 i$ `/ D2 f& Q; ~; GProperty 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>< >-------------------------------------------------------------------------------- 4 e& s, p9 `4 K8 J, q
Public Methods </P>< >public sub===Print (label, output) . x& N! j' r' G$ `" W
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
7 n" M) f R: d) K& A" g Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
$ y( p9 d3 v6 g" ~/ f Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
3 I. z% _5 @- Q& tMethods Detail ( u% D# D) ~, T: J
/ Q# b" g4 h4 _/ w0 |public sub===Print (label, output) " ]% l/ H8 ~8 o P3 X/ {! L; U
Parameters:
. Z+ ^( X$ t% \8 ` - label [string]: Description of the variable ; Y! d* }0 {! }) q5 B
- output [variable]: The variable itself 5 s# W9 a4 d: c$ H
+ o9 ^* G) O9 P) t! x, l2 j
public sub===GrabDatabaseInfo (byval oSQLDB) 6 n9 W1 h, {4 i% O( A# V. y {
Parameters:
$ Z5 Y t1 y! ]7 d U - oSQLDB [object]: connection-object</P> |
|