- 在线时间
- 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")) 6 w; f, |2 R" a0 i; X; Q; z
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) 1 c! B( Q& M: ?2 P
End Sub < >'***********************************************************
$ k- t& f+ G8 L: F7 y4 C'* PrintDatabaseInfo ( x$ i: O% E& O9 J# a' D
'***********************************************************
! } `" y' ^3 F" \# aPrivate Sub PrintDatabaseInfo(byval DivSetNo)
: H! z3 \, t0 o% h dim tbl
1 S7 |0 u& _+ l ]- \ tbl = MakeTable(dbg_DB_Data)
; B7 x( K: Z+ k9 B( S) l; Y4 Y0 O tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
- N0 f6 M A: r7 P Response.Write replace(tbl,"|", vbcrlf) ! p! f7 |1 e, ~3 n9 r# T
End Sub </P>< >'***********************************************************
2 q& n" P V6 U+ t' l$ L( c0 c'* PrintCollection
$ L0 u. O. q, U a2 G! M& d'***********************************************************
7 Q* K9 N E- X5 @9 JPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 6 G) P: j8 H, J9 P( H" f0 D( t4 f$ Z! Z9 F
Dim vItem, tbl, Temp
: w" Z6 U4 K5 d& @5 q- ] For Each vItem In Collection " J* O* {- b5 }" j
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
: p* ` W/ | X& \! V6 i tbl = AddRow(tbl, vItem, "{object}") 1 W( ? u1 R# s/ W- |. t! m
elseif isnull(Collection(vItem)) then
+ i& }9 i5 z- J& s% `6 t3 A tbl = AddRow(tbl, vItem, "{null}")
1 [& n; B: y4 c, d' n) C5 F elseif isarray(Collection(vItem)) then
) c9 m' c& n" y" E/ ~4 W, X3 M tbl = AddRow(tbl, vItem, "{array}") 3 H' X3 w/ N9 X5 q* ]' b3 v. l' d
else
4 q5 u1 C* t+ U& o* d$ H# j if dbg_AllVars then
, V( Z0 n$ U, n tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
; _* I! V6 [$ S! _* v$ ^2 L elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
" T" K, C5 g2 _$ U! n if Collection(vItem) <> "" then ( U; [' W9 q7 _& e O
tbl = AddRow(tbl, vItem, server.HTML
& _+ Q$ c h4 MEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") . f" F2 c9 H- c+ S
else
@2 E5 c' w; v" h& a tbl = AddRow(tbl, vItem, "...") Z+ w6 s1 f; m
end if z* F, Z4 X% c7 T! e+ K* i7 E
end if
; |. B: e! q& F0 c2 P2 L n end if 7 B3 ?, Z8 P! H$ q# \. q
Next ' y! S+ P. q* s& w$ V
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
. Y" L& n3 t _% D* ^ tbl = MakeTable(tbl) 3 v. h( x4 @' E5 ^9 v
if Collection.count <= 0 then DivSetNo =2
6 M( x$ X9 Q* M5 ] tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) % ~; R/ I( C: P, d+ i% C' w
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
' G: {3 J; A: j( G" v5 h0 O9 a Response.Write replace(tbl,"|", vbcrlf)
- z' n& Q2 N' B5 H2 C) VEnd Sub ) k+ D1 P c, a- c. R7 X
7 [7 h4 {4 O4 Z s+ ]# e
'*********************************************************** + C; V/ ^6 U! Q3 G
'* AddRow N5 X# b& F, L) [# R
'***********************************************************
8 n6 R7 F8 L0 L/ J. ]Private Function AddRow(byval t, byval var, byval val) / ` d5 Y( U9 b9 k! v, @9 M
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
& D! v6 l# _; J" e; f M AddRow = t - R' e, O! w# Q" {7 X8 j
End Function </P>< >'***********************************************************
! o2 N+ r9 Z& z6 c4 o% J- N: y: O'* MakeTable
' y/ U x: D: M4 @! F6 m! b'*********************************************************** + f- |8 ]$ {* \2 a
Private Function MakeTable(byval tdata)
( }2 F2 b* Q; ` e5 `% X tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
* Z/ l& \+ j" c8 @5 h7 U1 e MakeTable = tdata ( i- Q! e$ g. u1 j/ b, ^6 B4 m# v1 r
End Function </P>< >'*********************************************************** ' m4 I7 B6 C& H" X- `) Q! m
''@SDESCRIPTION: Draws the Debug-panel
7 H* p) I% T7 j% d# [4 b$ N5 ['***********************************************************
4 C* p; { `: I' d$ Q- ^Public Sub draw() 6 W$ [- a: e3 c/ s- o0 L
If dbg_Enabled Then
) n6 L9 c7 v# J! j dbg_FinishTime = Now() % Z9 E( c4 S7 _9 ]( c' }
% i1 I6 Q8 }+ P3 E Dim DivSet, x
& m7 w& i' t4 z. R0 r" { u DivSet = split(dbg_Show_default,",")
6 d: b$ v5 N0 \5 d7 j z- Z dbg_Show = split(dbg_Show,",") * h0 O3 w8 ^, s- F" y1 c
9 q* O0 E7 D* \& A For x = 0 to ubound(dbg_Show) , X1 u) k2 M( y2 o5 G2 X
divSet(x) = dbg_Show(x)
8 C; L: u; I0 o) I/ w( a& h Next / M9 Z4 s9 H$ b @! z
" |5 _3 u9 s0 o- h; ~# |5 d0 R
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>"
% }9 a6 Y- _) C0 i0 @! M Call PrintSummaryInfo(divSet(0))
6 N1 C3 C# u2 B( k2 y3 N5 a2 v$ L Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
) a: X5 x R2 E3 L7 y, p4 k Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 3 ]/ T1 f. g) m, _6 P5 m* [8 N
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
6 X5 j) c& F2 ?1 S- R Call PrintCookiesInfo(divSet(4))
* N {; F9 T# B b) f 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 D- ^+ v% y" {! p Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
% Y& ~8 Y: g3 @; f( M! a Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 0 d; J* z$ I+ A$ @- E
Call PrintDatabaseInfo(divSet(8))
: w: M/ D1 K1 T; W& ^0 } Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") % S2 ~" O4 |6 \/ d! q. ?7 C
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 3 E3 y# A" s# M, |! b( B/ }6 ~
Response.Write "</Table>"
) g" l" u7 X$ i! h5 T' Z End If 9 S* Z8 p/ U; _. m6 @4 i
End Sub </P>< >'Destructor
' U) ]! r' z5 a: [Private Sub Class_Terminate() 1 F. S3 r; e. q5 `
Set dbg_Data = Nothing 4 D7 p+ C* X$ Q( x0 v6 T7 K
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >" E: B# J# Z. n
CLASS debuggingConsole
& H" E* U) X; z3 K" O% DVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false * a7 ]- ]6 }- a0 V6 X X
&n
, X( T/ S4 h( N8 Mbsp; % W* K$ R& X0 B+ [6 y' S' e6 G' ?
Property Get Enabled===[bool] Gets the "enabled" value
6 p' w: E8 {# v4 ]
/ Z( |% A2 y0 X- f F3 m) C/ c5 ~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 7 c( V$ v* ?7 ^
6 D: ^. E5 [+ vProperty Get Show===[string] Gets the debugging panel. % N N' [1 E; j$ P4 |$ N
+ H4 O$ ?* \! |/ S7 B* F' jProperty 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>< >--------------------------------------------------------------------------------
) `, N1 O! A8 X4 Y, nPublic Methods </P>< >public sub===Print (label, output)
+ \( |8 O' j; m Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) * h; u4 p( d( O" S+ a
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () . I: d5 t% C$ z$ k7 x
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- ) C. {# @, |; p' r
Methods Detail 3 j9 D- K7 G; ?2 g
/ J4 z5 f4 C# o' F
public sub===Print (label, output)
% }7 p5 b0 ~3 sParameters:
: e' P$ [; X5 B; ` - label [string]: Description of the variable ) N4 N- X- ?. H' A5 C c9 T
- output [variable]: The variable itself
2 J4 a4 U2 n/ Q$ q ! W6 a4 P& o& M& ^& C
public sub===GrabDatabaseInfo (byval oSQLDB)
* V& ?& k% q9 e: Z# ~Parameters:
: D8 g+ j- V, G( j1 G8 Y2 A) ] - oSQLDB [object]: connection-object</P> |
|