- 在线时间
- 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"))
% s' b2 u" Q' C dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
' z1 }% J$ y# w6 M! F0 aEnd Sub < >'***********************************************************
. L/ O+ _/ U- u! u/ u. {, @. U+ w7 J0 y+ N'* PrintDatabaseInfo ( m @$ V5 M/ m/ |2 ~
'***********************************************************
' G8 ]7 \2 O0 ^! `& ~Private Sub PrintDatabaseInfo(byval DivSetNo)
( u7 u, d5 o h* [: F8 f! {' g; F dim tbl
" _7 ]2 S( h0 v8 M. Y tbl = MakeTable(dbg_DB_Data)
4 h T( z- P5 N1 w* [' U9 p( t tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 0 K& v( N' S4 f! u# C
Response.Write replace(tbl,"|", vbcrlf)
+ {, q7 I4 V( S zEnd Sub </P>< >'*********************************************************** Z) U+ i. L% ?# n
'* PrintCollection $ _( l( |- v, q- T( k
'***********************************************************
* L R3 E; b& T& QPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
2 ?) |0 {+ g8 q/ C Dim vItem, tbl, Temp " {0 s- Z3 q; K
For Each vItem In Collection
1 W6 `7 u4 X5 g# N) n if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
H% S, x, M3 c y$ U7 u+ K tbl = AddRow(tbl, vItem, "{object}")
2 i2 U, _ n( ?) } T/ R elseif isnull(Collection(vItem)) then
3 T6 a# b7 {, T, P( B tbl = AddRow(tbl, vItem, "{null}") 0 W& L1 _$ e3 w) H0 q
elseif isarray(Collection(vItem)) then & J. H+ i8 k: R$ r2 h! r/ j
tbl = AddRow(tbl, vItem, "{array}")
3 j: Z c5 Y5 \( @* o! r else
6 T+ ^! k3 M) N9 ?9 T if dbg_AllVars then
8 c% v( d$ W5 A* x tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
/ M- h! [5 _! _* Q5 J) L elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 3 m0 b& b6 x) D
if Collection(vItem) <> "" then 5 L+ P6 V4 ?3 }7 {2 l0 V
tbl = AddRow(tbl, vItem, server.HTML
+ N, V! `8 I; z U% |& cEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
( ?! Y1 n c0 n a else 4 @9 O/ p: v7 O% S! ?: V
tbl = AddRow(tbl, vItem, "...")
4 N, {4 t7 d- X; e4 U* D end if 2 T- \! H, g5 ~' W
end if
g5 F! p A0 o- l end if & F" i8 [9 A' ?; l/ N( c
Next 2 y( w( G1 d/ U: g L3 Q! m6 x
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
4 u6 }7 F% j3 U$ `4 K+ q5 i tbl = MakeTable(tbl) . u, _6 W9 J$ A( D% A6 `
if Collection.count <= 0 then DivSetNo =2
! Q2 I+ _/ \% b% @6 s1 T tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
5 f- W% U2 E! |6 v7 _+ d tbl = replace(tbl,"#sectname#",replace(Name," ",""))
9 F( X/ R g+ w# O/ C4 L W Response.Write replace(tbl,"|", vbcrlf) 3 Q4 W' T! F5 {" s
End Sub
, D; Z% Q2 z. {9 {0 x9 c
9 K/ n% C C* V$ c! |'*********************************************************** $ t5 n! K5 }) W4 j- G0 \
'* AddRow ) f3 n3 d6 H7 S4 q R7 b
'***********************************************************
& `+ S D9 n* kPrivate Function AddRow(byval t, byval var, byval val)
0 y& c4 _, y) V, S4 V9 m6 ] t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
0 N+ T. U) p6 O8 D$ k( F AddRow = t $ Z ]; ` e* _. {
End Function </P>< >'***********************************************************
2 B; q+ G. O+ v2 k9 S6 \2 h'* MakeTable , A' a+ r6 X- e' n' u
'***********************************************************
- U: |4 N& D- R7 JPrivate Function MakeTable(byval tdata) ! w6 U2 q3 h( {# i& [0 H
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" ) o6 n* S7 {8 _2 R
MakeTable = tdata t' r6 I7 F; U( L! v
End Function </P>< >'*********************************************************** ; c9 z, H! E M2 i+ V
''@SDESCRIPTION: Draws the Debug-panel
* \" |+ |# G m1 A: N1 v'***********************************************************
9 r1 o; j* y9 a" h: C, X EPublic Sub draw()
: _$ G2 j& E Y, O If dbg_Enabled Then / c7 q( `; m# j% J- _- V
dbg_FinishTime = Now()
4 o- R, R! T' d( f1 K/ m1 y# C) Z 8 v4 E1 v) H+ z
Dim DivSet, x
. E+ d; ^2 `) e" y4 S DivSet = split(dbg_Show_default,",") 2 F) l- G( O" f/ E4 s: e
dbg_Show = split(dbg_Show,",")
4 \1 E1 ?7 ]4 V# ^& w8 ^( F0 e
7 s' w% I/ R7 o5 ~ For x = 0 to ubound(dbg_Show)
7 C) y. p- U' [+ J, I6 R+ N divSet(x) = dbg_Show(x)
. i9 b. G9 `/ h! Z6 k3 \8 V3 A Next , V/ x$ H' c( F9 G8 m" d
( _/ C4 |. H3 { 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 p8 i) n3 M( `2 {, f Call PrintSummaryInfo(divSet(0)) # M, k: ?3 Y' ? m
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
" J7 l; {7 ~4 I! t Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
" F ]+ ^7 I* e Call PrintCollection("FORM", Request.Form(),divSet(3),"") , m3 A, N/ M; V9 z1 y
Call PrintCookiesInfo(divSet(4))
5 L2 P+ T) H2 i3 j g 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))
" F; F* o7 }0 h, A Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
# A! |# t6 g! i* ~; o: A Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
1 u% G# M. I; F0 g' F6 N Call PrintDatabaseInfo(divSet(8))
' X2 {% i) @' c. o# K Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") . o) p, D- |# u4 O. V
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 8 c2 B; G5 b" t3 U" o' i
Response.Write "</Table>"
# R: u2 J3 W k' x( `! O1 F End If X& k3 [! v8 v4 K! F
End Sub </P>< >'Destructor - K9 P9 p$ Q; N; k; j- C2 I2 B2 b
Private Sub Class_Terminate()
/ t# s: d& m1 ]* d Set dbg_Data = Nothing
( x% W/ Y. T* C/ t. WEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< ># W$ g# `0 g! d5 q& c3 A& g
CLASS debuggingConsole
6 A% {7 x. @4 {( l4 NVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " i4 P+ O/ N) i: d/ t& t
&n
" K! x6 o( c" ~4 _ ]bsp; 0 Y* w) z' L" B( ^; K8 F, v
Property Get Enabled===[bool] Gets the "enabled" value
$ r. Q$ {1 r0 Q* \: R, P
; c6 P# Y H7 Q0 ]; WProperty 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
, O9 B8 P# ~3 u, c% {% W+ d( S
5 D, r b* s0 a' W; R7 R* tProperty Get Show===[string] Gets the debugging panel. . i2 X, S9 t! h) P! ^2 D E) r4 W( {
0 f. F" U6 }- q1 _; K- l" u
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>< >-------------------------------------------------------------------------------- ' B8 a; D5 A1 q1 R+ N' y* r
Public Methods </P>< >public sub===Print (label, output) : d* M/ B( e9 f K
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) ! ?5 p! h7 m P8 U3 |5 D9 h
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () 3 p% [/ [6 f0 q7 [
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
( O( m/ ^7 \* T |$ @Methods Detail
! P" w5 i7 h9 y- n( ~# Z ' ^+ p6 r6 z& M% B* Q0 l; Z$ |
public sub===Print (label, output) 1 m j9 M% x. Q+ O* h1 w/ P
Parameters: + A, o- Q+ J& A
- label [string]: Description of the variable
' M# V0 N5 s$ E% Y3 r9 e: S4 X n - output [variable]: The variable itself
1 a) R- W+ K+ g/ s) J, B% ]6 K 6 v z% M$ {8 f
public sub===GrabDatabaseInfo (byval oSQLDB)
- J. _$ o( J: V2 F8 i$ D0 DParameters:
6 L5 g0 _+ i% Y$ b z" F - oSQLDB [object]: connection-object</P> |
|