- 在线时间
- 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"))
) }, n: S3 N! u( _ dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) ! W/ s6 _5 U$ H" Z7 g, l
End Sub < >'*********************************************************** : P4 {% n1 Y6 E7 I
'* PrintDatabaseInfo
4 h/ [- G2 F' y, o' y$ n$ C3 u _'*********************************************************** ( u8 O* G! l9 X+ L) N+ {+ s' ] L% T
Private Sub PrintDatabaseInfo(byval DivSetNo)
9 Y6 v. c/ i# m dim tbl
/ J6 {& z/ s _5 H9 X# v: A tbl = MakeTable(dbg_DB_Data)
( Y f( f0 O6 v4 v tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
8 I6 w6 J, B: f6 {5 X0 { Response.Write replace(tbl,"|", vbcrlf)
' D2 `' c& i: ^. K' D. qEnd Sub </P>< >'***********************************************************
9 c) Q( N5 c3 I( c0 h'* PrintCollection
& e1 L4 m% M+ M$ M" a'*********************************************************** ' j) J, }9 n& i% R9 F
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) $ a" `( {/ ?# Z( }
Dim vItem, tbl, Temp
- N$ q) [- `+ t& u8 f$ h& W For Each vItem In Collection 9 N W& T) y2 A/ w: _9 d
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 6 F( U; p/ v2 e8 z: W( s7 U8 X
tbl = AddRow(tbl, vItem, "{object}")
9 w2 m6 e. [0 W8 Z elseif isnull(Collection(vItem)) then * B5 F2 `5 z- q# }
tbl = AddRow(tbl, vItem, "{null}")
4 N4 \9 U7 S6 N elseif isarray(Collection(vItem)) then A( x% |8 Y$ {% x5 D( l' @. V
tbl = AddRow(tbl, vItem, "{array}")
! T% E+ i- l- [& j( I else * F! m8 _) L; i; S3 q
if dbg_AllVars then , [. v5 N& O$ Q5 ~& c& }; _/ D
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 5 u0 _' r3 O2 `( z$ f6 c
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
8 C5 e, k% K3 z; N if Collection(vItem) <> "" then # |8 f' b# b6 }/ H+ q. W
tbl = AddRow(tbl, vItem, server.HTML6 P8 H; N% z" O3 v1 w7 o9 W
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") & Y' b6 _" z6 K
else
5 d: r' m0 B1 u- w6 N' ] tbl = AddRow(tbl, vItem, "...")
0 A5 t! |" d. d {: ], b5 q+ c end if
' b1 N8 Y# L! g" u0 y end if & r. e& Z( `. r+ ^2 K
end if , J' T3 Y3 L8 |/ a
Next
3 M/ m/ y" i1 V8 \ if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
8 B C7 \5 j, _2 A+ V) h tbl = MakeTable(tbl) & L _$ i" b2 e4 x
if Collection.count <= 0 then DivSetNo =2
5 q6 M6 T( P% o0 e4 i e5 j E tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 6 E4 W7 f- ]4 E! g' [6 f; C; a
tbl = replace(tbl,"#sectname#",replace(Name," ","")) " x' @+ i7 `1 F$ T8 ^, h1 Y
Response.Write replace(tbl,"|", vbcrlf)
: A# B. R8 I6 a$ CEnd Sub
p' D( g& K, v7 s) l6 `" B " f" w% m. L8 ^ T! r" a1 Y
'***********************************************************
/ G8 m9 N R$ A6 J'* AddRow $ Z5 b: ?# @' z1 z
'***********************************************************
2 z( `+ c' e9 r. APrivate Function AddRow(byval t, byval var, byval val)
- `% j" D1 X8 L t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 5 g" {7 H3 e& v1 j: P& E
AddRow = t
1 b! v Y4 @/ H& J, KEnd Function </P>< >'*********************************************************** % k# P2 O2 p/ n; `0 B
'* MakeTable
w% Y! G% I+ C'***********************************************************
- ]/ o6 ~6 A5 {+ HPrivate Function MakeTable(byval tdata)
8 m4 Q6 X/ `% o tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" - D# J E* S# ]1 \/ H- k9 `+ b
MakeTable = tdata
( W3 g g7 Y1 d! H+ q- ]# @+ XEnd Function </P>< >'*********************************************************** C0 I) |5 b6 c0 x: k
''@SDESCRIPTION: Draws the Debug-panel
4 m3 H/ w$ P7 Z4 E7 o'*********************************************************** ; H9 m# |/ @% F$ G- H: |" x, `
Public Sub draw() 9 Z+ B5 G3 n6 G9 z9 e
If dbg_Enabled Then 3 J$ _! W; i" I; a* R. ^' w
dbg_FinishTime = Now()
2 h5 b1 a7 `, o6 F0 x* Z
$ J; q2 d9 ^3 ]$ n6 S8 Q% P Dim DivSet, x
: h1 E y2 g C7 c DivSet = split(dbg_Show_default,",")
& s; a: B- U0 s dbg_Show = split(dbg_Show,",") 7 s, {# d9 Y3 \
+ J! w4 Q0 p! ?$ U For x = 0 to ubound(dbg_Show) * a) d- G, X3 T8 ]. L: K
divSet(x) = dbg_Show(x) 7 c0 A5 D$ B0 \1 U8 {7 n
Next
- c& X1 f6 c1 S) `
( W& L0 K1 ?. z1 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>" * d% d0 P) x# T. V+ U4 P
Call PrintSummaryInfo(divSet(0))
1 D0 S8 O- ^' k/ w3 _- z Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") " f ?6 n- d- }# }* H9 X& V
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ( E4 ^1 e; ~) B$ d5 Z2 m0 J) I' `
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
Y" ?% R# n% w Call PrintCookiesInfo(divSet(4))
9 X9 t. c3 U8 G. n- I- w 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)) & `! V! z2 Y9 q/ @+ @) e2 W1 C, o. S
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
8 I2 O/ S# R1 L/ c$ t- }0 n1 X0 g2 G Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) * F& A9 ~, `# r
Call PrintDatabaseInfo(divSet(8)) / W3 G2 Z8 s* @4 _2 N
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") : H4 q: r5 z1 E7 l1 g; X V
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
f6 E( C1 B$ W8 n' x# [ Response.Write "</Table>"
1 ]& |. F3 G3 ~+ c# k End If
- q$ G6 T' Y- ~ B) z+ QEnd Sub </P>< >'Destructor
: ^! Q$ S/ y; _. c5 E6 a3 V4 O4 BPrivate Sub Class_Terminate() ' h! R9 m$ o, ]5 _- m+ h% A& {
Set dbg_Data = Nothing
6 H/ V% C) L, F2 ~End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
7 P8 ^! ]8 y2 f) BCLASS debuggingConsole $ j8 t& ~$ _- ^, p( S" a" z/ h8 k
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
% p+ B1 E0 f7 ^$ r&n. |! `# g; D# J% n2 N7 S/ p2 g
bsp;
6 v8 J& ?) L0 x& @" a* T. m* cProperty Get Enabled===[bool] Gets the "enabled" value 4 l- t; U3 S: F2 D; \$ X
) V. w+ N: ^$ u/ v9 f4 D. n
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
5 @( R3 Q# q3 U& {0 Y
0 Q) v0 y8 v8 p; N- R* m" zProperty Get Show===[string] Gets the debugging panel.
! {& F& E( \! A( `. z; ?; \, u b
+ }9 }! g* O1 b$ _' [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>< >-------------------------------------------------------------------------------- 9 n: d: @ r* Z, x
Public Methods </P>< >public sub===Print (label, output)
/ I$ c4 G) Y3 |+ f( e; _/ C% X Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) ) }/ v9 I/ T) Z
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () 8 s; q7 {, @! g4 g/ w
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
$ o7 q7 N! O9 ~- N$ i. RMethods Detail , v: e4 Y m( B3 P6 R
; t- _( J8 r& g* e8 W/ Y
public sub===Print (label, output) # C( E2 z) `5 G1 W' |# z% A
Parameters: 9 E: k& Q1 e9 Q; {
- label [string]: Description of the variable " Q% ^0 B! d" l1 U, t
- output [variable]: The variable itself 0 `+ D/ m1 n. b2 e
# u W6 B( `5 |& z" I, {public sub===GrabDatabaseInfo (byval oSQLDB) 6 ?3 r1 Q0 s3 L( Z g
Parameters:
" j$ a: Q( i2 p: M7 ?/ T9 _7 O - oSQLDB [object]: connection-object</P> |
|