- 在线时间
- 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")) + a- ]. B& t C2 M& Y6 f {' W# Q
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) # e# y6 Z3 m, b
End Sub < >'*********************************************************** 8 U" H% [2 y- \/ f# _0 G1 @
'* PrintDatabaseInfo - f8 X$ U5 @ ]0 F
'*********************************************************** 0 _, _3 R! b$ B8 |. R
Private Sub PrintDatabaseInfo(byval DivSetNo) " ~$ L4 [# D; p( e z
dim tbl
9 F& d9 k6 d5 @6 ~- e5 N2 ^ tbl = MakeTable(dbg_DB_Data) ) j3 \' v" ^# y1 o( p
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
' o v6 G7 L2 |& A7 d Response.Write replace(tbl,"|", vbcrlf) 3 x* ?+ I8 \8 ]4 H; f
End Sub </P>< >'***********************************************************
/ H' h! z- S2 F'* PrintCollection
/ t4 t, [! D6 o% G: z' I'*********************************************************** m" o* E7 {7 R# @: A
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 9 A7 {( p8 n. P3 |
Dim vItem, tbl, Temp $ a0 c2 k3 o, e- J& b
For Each vItem In Collection
+ V; A, W* X* y6 z& L$ P. z if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
0 t% P. b0 G/ l3 e& |% G0 t/ S, o+ p tbl = AddRow(tbl, vItem, "{object}") : L! I" x% `6 U: P! e9 V
elseif isnull(Collection(vItem)) then 0 E( D0 r }2 Q
tbl = AddRow(tbl, vItem, "{null}") ) g8 o2 o$ z* L0 w% b r: W
elseif isarray(Collection(vItem)) then ; j }& D0 N: N: b
tbl = AddRow(tbl, vItem, "{array}") . P* X! G$ E* b5 C' w
else
' W/ d/ ~$ v0 N( C3 w. a5 \+ c if dbg_AllVars then 5 e, ~6 l- N$ G' w c' ]7 K
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 0 U* J1 p# h/ O3 c- q* d6 r3 W. Z
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
2 g. K2 x0 B% X* R, b/ L if Collection(vItem) <> "" then
/ T6 N$ \. f* ?6 o! v5 L tbl = AddRow(tbl, vItem, server.HTML
. v+ F6 l$ f( c/ f" |2 e# ^8 vEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 6 q: K. N& Q$ o( x1 @
else
. t# Z; v5 U& \' w tbl = AddRow(tbl, vItem, "...")
0 \9 Z( v# ]- K+ i/ x9 [8 y. l5 K end if
8 o h# O( h/ i5 l7 d4 d2 N& e end if ! G. `& Z5 q" O! Z+ R
end if 8 o" D. s: N1 N: b5 H6 w' Y
Next 9 \! S- f; H, ]/ E; l/ }! F% r: f( [
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
" D) G U$ v, Y tbl = MakeTable(tbl)
% Y( x5 Q# ?; L% [$ z if Collection.count <= 0 then DivSetNo =2
/ H4 T" O" ^: w5 A+ j tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) * |. J: W) x/ \8 ?: h% O
tbl = replace(tbl,"#sectname#",replace(Name," ","")) 5 O- C; P G) h2 M3 w' P
Response.Write replace(tbl,"|", vbcrlf) ( L1 L7 B, y$ _+ X- j8 |
End Sub 0 a v9 ~! u6 `7 U0 l) ]0 u
$ f3 [- r" a3 A; H5 J% n9 t
'***********************************************************
5 m7 _) @" X% I/ k& t. k3 W1 d; t'* AddRow ) t! U' \/ F0 ?( ^, u
'*********************************************************** * p d Z3 ] K& u0 m# R
Private Function AddRow(byval t, byval var, byval val) ; m7 N# }+ U/ W6 B) r
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 6 \3 H6 W4 _# [; V8 u9 V3 K) ^; f0 S
AddRow = t , @7 F, t! c' `! U8 u x& ?
End Function </P>< >'*********************************************************** # V Y0 ^6 K5 s; U/ g8 Y: J' b
'* MakeTable
2 r) C+ q1 M2 L0 c! c' w3 E7 s7 I'***********************************************************
0 V8 W( S! U% E1 QPrivate Function MakeTable(byval tdata) ) Z- T" S1 I: w1 z6 T
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" " s' D& _4 ^* q
MakeTable = tdata % Q) m7 F: V* ]- c3 ~- ?
End Function </P>< >'***********************************************************
! i, G6 K% u, |0 r+ i6 d''@SDESCRIPTION: Draws the Debug-panel
, E' T- {2 G" h u7 w'*********************************************************** 7 R( y' c" C6 ^ O |7 X" l8 U% D
Public Sub draw() ! D$ r% L5 l1 w) `
If dbg_Enabled Then 3 w' w6 g# E# I& w7 M( s2 `3 R2 i
dbg_FinishTime = Now()
% l, n. B8 F+ x
( ?7 ?* A4 X9 J# H5 x) A Dim DivSet, x 4 G9 X8 Y* f- \5 k
DivSet = split(dbg_Show_default,",")
) P' V; T- ?$ v& U dbg_Show = split(dbg_Show,",") 0 u @/ I) Q, H! n
# A# g7 q; ?( G _+ G S" ]: j, y For x = 0 to ubound(dbg_Show) 7 b- X% Q; d* ?; m% `: W1 V
divSet(x) = dbg_Show(x) ' q2 R7 r& U$ j- U( Z* M
Next
/ [% n4 ]# `0 n, U& i
9 I. d* e, o9 B( [+ l3 @& R1 W 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>"
4 j, y8 j0 l/ ?$ x# @+ e/ O9 M0 A Call PrintSummaryInfo(divSet(0))
' B8 |9 W5 [" |" Z8 s Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* F! R. | r% y Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 4 n# J1 e1 D0 T
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
8 b( `/ |7 s* P5 R Call PrintCookiesInfo(divSet(4))
9 q8 J" s+ m3 n: d 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))
2 g( p6 p9 S% N, \ Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") " \7 ?* ]" B. A+ i
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) : S2 h1 m9 M. B1 K4 Z, o
Call PrintDatabaseInfo(divSet(8)) ' T$ w3 R$ H$ M& c& o
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
l) x8 |3 a ~# k) n6 l Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
6 J4 a# y2 i9 ^0 i: E' j. G9 e Response.Write "</Table>"
+ B. ?0 s5 m. Z End If
* u. u' n7 [9 _1 VEnd Sub </P>< >'Destructor
0 k7 c0 j5 @8 y8 k& KPrivate Sub Class_Terminate() ( q' L( E; S q3 b. b7 ?
Set dbg_Data = Nothing 2 W5 e: W" }& l" I/ k2 S% B
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
+ G; @$ G& O( o7 V* h$ H( rCLASS debuggingConsole
' v! b8 V0 o* v( o' W1 rVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
$ y4 T4 Z" X: A) Y: Z$ q&n
% @. Y8 l) j- a7 N$ s& nbsp; : s, j! P$ M5 B6 ~
Property Get Enabled===[bool] Gets the "enabled" value
" n% R! U% U/ r% V1 r( B } 7 ?$ l5 }% v& M8 U
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
: R, d. ]) P2 C
+ k% z+ Z/ L) j% B, gProperty Get Show===[string] Gets the debugging panel.
) n! X z! K4 L1 e ! j! g2 P1 f |+ K
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>< >--------------------------------------------------------------------------------
' d E3 ~1 x. TPublic Methods </P>< >public sub===Print (label, output) , f5 s5 D* P* w2 G. [
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 4 }/ Q# C5 y5 ?4 n
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () 7 g8 A8 U( Y' r2 d
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- % n" ~8 q- ]' ?9 Y$ `
Methods Detail
" y! J. h, ~; H* @ + G8 a* x5 |3 I3 y
public sub===Print (label, output)
: O+ {" n4 @- V) m% |Parameters: ; i' y2 i6 |* F& l6 Y3 V0 a8 n; @
- label [string]: Description of the variable 8 W2 R/ q* s5 E) ?5 h
- output [variable]: The variable itself
+ a3 W9 F. p$ }% T ; [' L \; P/ y0 n9 E8 [# i
public sub===GrabDatabaseInfo (byval oSQLDB) ) {8 h0 d, K$ x# P4 V7 w9 z
Parameters: 2 C5 V& @2 X9 Y* L) e% @2 S* n
- oSQLDB [object]: connection-object</P> |
|