- 在线时间
- 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")) % |: _/ s5 V4 U4 ~- P" W2 w
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) / w- H1 j# H2 J; m
End Sub < >'*********************************************************** ( O& X! e$ t- a# H& q2 g1 F
'* PrintDatabaseInfo
0 r9 v& _: E5 k5 _4 v& o( ['***********************************************************
! ?1 F) o3 X2 w# SPrivate Sub PrintDatabaseInfo(byval DivSetNo) 3 E: c8 q) x+ {2 w5 U
dim tbl + F3 [3 P: _* [3 @5 E# ~/ v* E
tbl = MakeTable(dbg_DB_Data) 3 F- U' v& E$ i, C0 n
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 7 k7 F* s5 T, W
Response.Write replace(tbl,"|", vbcrlf)
: J: O- V4 Z. U |End Sub </P>< >'*********************************************************** " y, M+ r: \. m' f9 V
'* PrintCollection
5 o) _7 F" b/ Z$ [- t* y" {" S8 d: A'***********************************************************
2 c* L+ z6 c8 s9 d1 c% YPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
1 K( c7 ]7 W4 ]5 q- O Dim vItem, tbl, Temp 3 x% G$ T3 C4 |0 E4 C, c
For Each vItem In Collection 8 H: B; [9 Q8 [
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ( O/ v% B* C$ t4 T9 H
tbl = AddRow(tbl, vItem, "{object}")
3 B- L: |9 C$ L: r elseif isnull(Collection(vItem)) then ) m" P! G4 {( _4 v
tbl = AddRow(tbl, vItem, "{null}")
, M; w8 f s. o! N0 }0 B elseif isarray(Collection(vItem)) then
6 Y/ p" P( `* g tbl = AddRow(tbl, vItem, "{array}") ' h3 ]' N0 F; o) H/ y: I# G
else . f. E4 c% A3 O4 G$ L/ m
if dbg_AllVars then
! c; E0 g% n/ s1 u- V tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) : F+ ~# g, j( s0 y
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
7 K4 @1 M4 k4 [ d2 O* O if Collection(vItem) <> "" then
! G! i) O( G1 k' C tbl = AddRow(tbl, vItem, server.HTML
4 H9 F& f; ~; {4 B9 qEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 5 p& m4 l$ Z1 c; Q) u+ H- i# `
else + x1 d% V) ^% _0 O+ b/ t
tbl = AddRow(tbl, vItem, "...")
2 Y5 [% _, \3 y3 ?8 z end if
" n( o9 }5 k% p5 T end if
1 v. [- ?4 i2 a' p+ F' V end if y# k3 X* m& h1 Z+ p* S! }
Next
' g' R/ F+ @, v$ J* k if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo # r& B# V1 O+ j9 j3 Y) W. k
tbl = MakeTable(tbl) ?$ l* Y) \# ~' x' |
if Collection.count <= 0 then DivSetNo =2
; y6 Z5 V8 \/ ?0 [' A8 v, d tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
6 _+ ^' S% w0 H' x tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ z: g$ o+ p* ~ Response.Write replace(tbl,"|", vbcrlf) ) U, L# K& d0 o# x
End Sub , }! [4 d0 [& c( }1 S7 c* t2 G j' `
( s R* e% C+ W' D
'***********************************************************
- G d5 J; Y$ t- ?'* AddRow
8 r. A1 B7 d8 b2 V'***********************************************************
% K& E1 ?. @- l$ o+ KPrivate Function AddRow(byval t, byval var, byval val) & G. e d t- a# T! R; W
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" - ^1 `0 Q6 x) |2 b& B w
AddRow = t
; t2 J( S) |, N+ g! }& ]End Function </P>< >'*********************************************************** ' \( Y& G7 Y4 ^+ }0 A
'* MakeTable 1 ]( P) G$ r5 {; Q. S$ W
'*********************************************************** \( w0 E3 w$ ~
Private Function MakeTable(byval tdata) 5 r+ W$ s5 I) A9 v
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" + {$ I& z6 |0 H
MakeTable = tdata 3 J) ]" ~1 r8 x
End Function </P>< >'***********************************************************
# Q7 C1 F0 ]) X0 \- z3 ]4 G''@SDESCRIPTION: Draws the Debug-panel 9 c8 P3 h0 a* M% g9 S! z4 ]
'***********************************************************
! G- e( y7 | i% g8 \Public Sub draw()
R: O6 K: p# b* ? x5 q& T) u! q If dbg_Enabled Then
3 L6 T6 ?+ k* p0 C9 c1 V: M& O5 B+ F dbg_FinishTime = Now() ?$ Z/ Q9 X% `/ s
* B4 d% t* f$ T. r5 V# t/ m Dim DivSet, x
% R3 t8 U$ V9 e3 u( Y3 O: p DivSet = split(dbg_Show_default,",") 8 p# X. N4 r; J- }( y, L
dbg_Show = split(dbg_Show,",") p0 N: d7 H3 U1 P7 _
5 J1 {9 G( l- Y8 J' l# f0 M3 ] For x = 0 to ubound(dbg_Show)
7 k! ]$ P: B/ e' h divSet(x) = dbg_Show(x)
7 v: ?2 K6 V* w. J2 V7 {" \ Next + |" U/ A( E H
" J: c, J$ {" Y6 M4 z
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>" ! j9 f* u' Z/ J6 ~7 O, `
Call PrintSummaryInfo(divSet(0)) 3 Q8 e0 o7 B2 V4 Z; r( Z- _1 y
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
: T& L% p& q8 p( Q% { Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") % x2 q: V2 C L: }
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
, d" Q" u/ o4 Q: k) ~$ [ Call PrintCookiesInfo(divSet(4))
( `+ l. @& w* Y1 y4 P 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)) n" T- y% h) i9 L9 M
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
* Z- Y4 {6 r# q6 ~1 d, k7 m9 z1 A Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 4 V0 O) P3 E$ U7 R9 X. V
Call PrintDatabaseInfo(divSet(8))
( U9 E2 Q; o4 | Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
9 X5 Y5 U+ |, Z9 [' n1 ? Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") . l' }1 R( R& a7 @+ C3 z
Response.Write "</Table>" , {8 K4 q. k2 H
End If : X8 _2 l" r" d5 {- i( h6 a
End Sub </P>< >'Destructor
! }0 H- _6 w$ R. ~: N: D3 {Private Sub Class_Terminate()
" ^6 B9 \8 e) {0 ^) ~ Set dbg_Data = Nothing * N. \3 ^) \5 A) I% J& A4 t
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >7 W1 l6 V! v, I8 Z+ C1 E
CLASS debuggingConsole _. y/ @, C8 ?: v l! ~ w, n+ c
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 2 ~+ Y( S) ]* Y6 E
&n! T* H1 t$ r4 u) W t. {7 M
bsp; ( f4 |4 A1 v& Q' v7 u
Property Get Enabled===[bool] Gets the "enabled" value
+ e6 l1 a' V# ^) w. |$ b3 a) | : P$ ^" [/ F2 m3 j$ T# e7 {: Z: H% j7 i
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 ' B* J* |' C$ p
7 ?% |9 _5 P6 S% _/ oProperty Get Show===[string] Gets the debugging panel. ( F- ?, [4 U1 I6 ] ^' n
# {, ?7 a; t6 `! z+ FProperty 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>< >--------------------------------------------------------------------------------
$ R' e3 I. r' L& a# h1 h) @Public Methods </P>< >public sub===Print (label, output)
3 j' X- }+ M+ P Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) ; v# {! o: m W( G0 y! m7 w1 B
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () : C' h3 |* [7 d1 e9 _3 }
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 9 |- w3 J8 I3 j4 U7 ^: A
Methods Detail ~, e1 L; X% Z3 t
2 K A: G& N2 z; R9 H: W
public sub===Print (label, output)
8 f9 q9 x% A N4 }( c8 S; vParameters:
; {% Y$ O0 u6 `9 E( U* B/ o - label [string]: Description of the variable 7 ~7 l4 y9 G' Y: s R& e
- output [variable]: The variable itself ' _' s1 q i+ b1 R/ a
0 v) T: [ R9 W' npublic sub===GrabDatabaseInfo (byval oSQLDB)
6 \- Q2 [) D8 I6 J4 K) t& R, `Parameters:
, E- V2 F% U `# a* s3 i, S a" j - oSQLDB [object]: connection-object</P> |
|