- 在线时间
- 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"))
o& r( y; a8 s: W4 Y7 n dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) * B4 d" ?9 V5 p5 Y% R9 ?' S
End Sub < >'*********************************************************** % @6 }. f! {4 q) I9 B) d; \
'* PrintDatabaseInfo ( }2 d+ u- S h9 z/ p0 k
'*********************************************************** 2 S0 I+ Z( y/ R) s) i& Q: f
Private Sub PrintDatabaseInfo(byval DivSetNo)
# Y) a4 V5 i+ \! G( A dim tbl ) g$ [1 s' K; ~$ }5 f
tbl = MakeTable(dbg_DB_Data)
1 x+ z+ ^$ W9 \, V1 o: g0 p tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 3 X2 _$ I" J8 }* [1 Q) f7 C) y
Response.Write replace(tbl,"|", vbcrlf)
: T; z8 ^( \$ `% f6 OEnd Sub </P>< >'*********************************************************** 4 g. Z8 ~, @+ \
'* PrintCollection ! x: N: T. B8 y @! m
'*********************************************************** 0 D" V! A2 J6 P) P8 G; ^" U
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
4 a I0 ^4 I& t Dim vItem, tbl, Temp
7 x& V' t3 W( ~0 z4 m2 C- a For Each vItem In Collection
4 c* A* \+ H* Z" l: n1 a& S if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then / f+ u# F3 O% j9 }
tbl = AddRow(tbl, vItem, "{object}")
9 n5 v2 h0 i$ f" { elseif isnull(Collection(vItem)) then
, ?# l4 h% D* x$ }* M tbl = AddRow(tbl, vItem, "{null}")
. T6 M. Q0 s* A3 E elseif isarray(Collection(vItem)) then
: k) L0 \4 Q |% v tbl = AddRow(tbl, vItem, "{array}")
; t% Z6 E4 f# t) A* f9 I# \$ Y U$ T else
- C2 y" s9 w7 G% C% s* R+ `- J if dbg_AllVars then
8 [% B* U* T) v9 \ D- \) K tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) # y% }. M' D, P0 _% @" @
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
% K- u% Q; R' K# { if Collection(vItem) <> "" then
" o# n% o9 C4 f, {( t tbl = AddRow(tbl, vItem, server.HTML( S& ~' Z6 y9 s: U' T
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
. }" ^( p5 \1 } else ( D0 x$ j( h+ o! ]3 ^' h. C- o
tbl = AddRow(tbl, vItem, "...")
$ S* e" m5 n7 ]% F; }0 H( g- y end if
' Y/ J9 @: n# [, _( M end if
. T& P" W. n+ ?8 M end if 9 ?4 `5 k9 E: O6 @1 {
Next ; ~" z8 R* C- R# D7 i& f' q& Z& p
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo ! }# ], Y, p* Y! r, M0 Y
tbl = MakeTable(tbl) " A- } O5 ^) o3 J
if Collection.count <= 0 then DivSetNo =2
- i/ n$ m- y) z' y% |2 S/ ^ tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 7 S. H: R/ H5 @- c. I1 K
tbl = replace(tbl,"#sectname#",replace(Name," ","")) + R9 c* _6 q( P3 `( P
Response.Write replace(tbl,"|", vbcrlf)
4 T. i% X7 \1 c. x {End Sub ( B6 i+ k: ?% E; L
" \" b; P1 A9 I \- `: W- e'***********************************************************
7 _. A r0 G0 S4 \'* AddRow " i) K6 s2 K( S, e0 @; v* j
'***********************************************************
/ e5 @3 \% }# q. ?4 i" W, U; f. L2 \Private Function AddRow(byval t, byval var, byval val)
4 k4 O! Z4 y. Y; b t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
: ^2 ^$ ?; Y- Z' _1 T x# q AddRow = t 4 q9 M6 O* b* X2 E% `
End Function </P>< >'*********************************************************** # n* h9 N+ x R: n
'* MakeTable 9 J% M* K* j: Z' h f% J
'*********************************************************** 6 q4 s4 G) g1 G9 ^8 w& T
Private Function MakeTable(byval tdata) 3 G1 N3 K: |6 Y/ m Q: x
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
7 K3 Q3 y/ k' }6 e" s+ v5 c MakeTable = tdata
! S/ u: H5 b1 HEnd Function </P>< >'***********************************************************
5 i: f, Q$ d5 z1 e0 j# M9 J: f, Q''@SDESCRIPTION: Draws the Debug-panel 5 T) P5 _/ r8 Z \2 x5 U
'*********************************************************** ! { [8 T+ ]- w# n3 N
Public Sub draw()
8 c6 X# E- V4 H: ~7 E6 o" F If dbg_Enabled Then
6 C, y* @7 o( s0 m' }) g- n$ R dbg_FinishTime = Now()
6 Z( Z7 o& b9 q8 k ; S c6 M& A8 F# O( S8 |0 u
Dim DivSet, x . a( s# s: N3 O9 L! X; o
DivSet = split(dbg_Show_default,",") 8 M0 O- Y' ~, q( r4 t4 ?
dbg_Show = split(dbg_Show,",") 1 G# ?' T8 u' T- ^. e4 Y
7 [# i; n& p" C' s. b! j For x = 0 to ubound(dbg_Show) 0 E) D& r( D$ S% c
divSet(x) = dbg_Show(x) / v/ ?; E2 g2 ?
Next
L! e% G7 v( Z
6 u- R* |! q4 c' c* j 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>"
. z+ s4 @' S, W Call PrintSummaryInfo(divSet(0)) 1 b" }- A; l; }# S! V* M; ?" C5 a
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") . x! _ |9 i |
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") + a: T8 v! N4 f4 c3 {
Call PrintCollection("FORM", Request.Form(),divSet(3),"") / M3 K+ [& E" v. ^- J T
Call PrintCookiesInfo(divSet(4))
5 ^+ u7 D9 [- D# [! Z. |1 a. @ 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)) * p3 X1 _, {# n! o* b. D- n
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
7 v" Q9 f7 ~( D) n/ w' [ Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
3 o3 R$ f+ b3 {7 c- {# F1 p7 g Call PrintDatabaseInfo(divSet(8))
+ A3 M) u- |- Q: V( P Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ( f. F/ A8 E8 e) v
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") " p, ]: f4 |" u. o" e2 g# f' r
Response.Write "</Table>" / a* k6 q* o5 Q8 j2 c; T
End If . Y a# g# \1 d6 z# }
End Sub </P>< >'Destructor ( {2 y6 y0 _3 Z* X. t% n. g5 ^
Private Sub Class_Terminate()
$ d5 J( L: {; l; L. }. b5 z0 | p Set dbg_Data = Nothing 4 S# Z/ _1 z4 C. l$ K4 S2 `, L
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >/ Q8 V3 o( y7 G" z4 E) y
CLASS debuggingConsole
" E5 d0 C* ~) ?Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
8 r0 m; p/ ?9 X: T& V* S2 i&n/ D5 h9 K- U4 c) A
bsp; ' y$ F6 ~, K7 x5 N4 ~, N
Property Get Enabled===[bool] Gets the "enabled" value
4 E) b% o7 w1 @3 K1 j+ `
8 ?! y& x w% Y& a2 ~) x: t3 EProperty 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
- s4 f. I& k6 z / |4 w i5 V( [* x! n/ l5 I! s3 @
Property Get Show===[string] Gets the debugging panel. 8 `- {+ o- n1 e' m f( _
: I/ e# @- m7 G! KProperty 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>< >--------------------------------------------------------------------------------
/ `' w9 f B( q/ [0 R0 P i' IPublic Methods </P>< >public sub===Print (label, output)
$ E: @6 v+ [! L6 J, F' L Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) # \6 D- \ U6 u' _- l# L* V
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
2 d! }- R) p( C {4 [' N8 i2 T/ c Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
8 W" } C3 x; n* T* WMethods Detail
/ G5 t* M5 y0 D: |6 A
: X% s" U! L6 N$ o$ qpublic sub===Print (label, output) ) t1 W& c. T4 t( v* c
Parameters: * o2 w/ S" `& z9 @
- label [string]: Description of the variable
U% V0 b$ r, e - output [variable]: The variable itself $ ]: L) ~/ }0 y
" {3 U3 B8 F: @8 Tpublic sub===GrabDatabaseInfo (byval oSQLDB)
2 |) t v' P2 j8 ], `* VParameters: ; M3 u' O8 {' w( ~% l' b6 Y
- oSQLDB [object]: connection-object</P> |
|