- 在线时间
- 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")) $ u8 Q' s8 o7 w4 ]9 {
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) 1 {: A+ w0 {- x6 Z7 n+ i
End Sub < >'*********************************************************** ) a3 _! Z' n1 w" k/ k4 w; ^
'* PrintDatabaseInfo
' k6 S" ^/ z/ i3 s3 E'***********************************************************
# ]( j" |5 l k6 u% o: x5 r) uPrivate Sub PrintDatabaseInfo(byval DivSetNo)
7 h) r6 w- |, M6 V! K) u6 i dim tbl 7 n1 k U: w4 W; V$ x2 ~
tbl = MakeTable(dbg_DB_Data)
9 R. N R1 H% P# H% r; U$ d tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 0 R+ s2 d& ~* |* Q
Response.Write replace(tbl,"|", vbcrlf)
, `( ?+ J m% X4 v7 EEnd Sub </P>< >'***********************************************************
! H+ f8 ?% D! _1 @'* PrintCollection & `/ x4 T! |& z9 S- H* O
'***********************************************************
' v- J( f# V6 k' z7 p( {+ bPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) . T9 ?* \/ n" t% m: i9 d- _7 \
Dim vItem, tbl, Temp , E% B' {: N7 g# p
For Each vItem In Collection # e8 G9 F9 m" Q) p4 Z" {3 k
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
( X2 o0 g: A4 B9 c7 R) Q. ~ tbl = AddRow(tbl, vItem, "{object}")
2 q; u4 _6 w5 I elseif isnull(Collection(vItem)) then , e; D" k4 q; c. y0 g& `
tbl = AddRow(tbl, vItem, "{null}")
& q4 g6 f/ d2 n elseif isarray(Collection(vItem)) then
3 w" o% v3 A* F) J: `6 U; x5 ? tbl = AddRow(tbl, vItem, "{array}") ( _/ S+ V( p- P* r1 c
else
9 @6 ?' @+ S( v0 L if dbg_AllVars then - {, \9 @* S) q% l8 a; U
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) ; G3 F ~, k# e% r& c
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 7 ?; A* B, x O
if Collection(vItem) <> "" then ; Q* K# \" |8 `' ~, m
tbl = AddRow(tbl, vItem, server.HTML8 f0 A$ L' b3 b: D5 C3 r
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
6 P$ a. \' f2 \- i" q+ V else 9 E: e' k. I- S' _
tbl = AddRow(tbl, vItem, "...") ( Z7 c' n9 ~$ Y$ m, L: M3 B
end if
$ }/ w" x; |" c w end if $ }; m/ |4 Y r! F( n4 L& ?
end if ! t( ?( g+ ~6 h. G* }* w+ D ~( Y
Next
5 ^2 B; p" B" o. V. J, R; i if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo & k+ a. X+ W; M' G2 ^6 `
tbl = MakeTable(tbl) " g2 S2 @7 q6 s+ y
if Collection.count <= 0 then DivSetNo =2 + P; v; U0 d( |4 V
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
, g6 c/ Y; T! J% u% D1 P# o tbl = replace(tbl,"#sectname#",replace(Name," ","")) 1 z! O' n/ e9 j, V0 h7 {# @
Response.Write replace(tbl,"|", vbcrlf)
4 e _1 F& M) \1 d2 H; bEnd Sub - h' F8 t3 [! \# Y5 ?& z0 T. A" M
$ G4 S; O; m0 @/ B1 j'*********************************************************** 2 X1 v% M4 ~' ]9 x1 W0 F' N
'* AddRow % z \+ h0 c+ `- ^7 C! E$ H
'***********************************************************
) P$ Y; D8 b; _ u0 v- G' T3 ]3 b+ d4 [Private Function AddRow(byval t, byval var, byval val) - y, H- }$ H2 q8 p6 b3 M
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
, m& l( V+ R3 W5 [* A4 W3 M AddRow = t 1 u' Z- i' G0 Z# A: c
End Function </P>< >'***********************************************************
( E9 [- R# ]: v2 O, k'* MakeTable
: v* R1 ^4 g+ ^! {3 E- q'***********************************************************
4 T6 S; o" E) MPrivate Function MakeTable(byval tdata)
# x+ c* i, R* H9 Q N tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 3 _/ L& _# G0 Y- M& F8 w
MakeTable = tdata , c& p2 z) S( F
End Function </P>< >'*********************************************************** 7 D1 G3 B8 H+ d5 ~' {! b E
''@SDESCRIPTION: Draws the Debug-panel
% F" G' D$ ^. t Q0 T4 Y$ ~: R'***********************************************************
4 s1 }1 ?! j5 a" d$ |Public Sub draw()
# e1 d% d4 x# K' H1 v" ? If dbg_Enabled Then ! k4 V! y; M0 U: a7 ]& D7 \" n
dbg_FinishTime = Now() 0 P* Z9 X8 E* d+ u7 t9 D
3 X% H) c) b; A& u/ o: P# A w Dim DivSet, x
& Y0 D; Y* q% P0 ~9 J% T# T$ O DivSet = split(dbg_Show_default,",")
/ z. `" F9 t9 Z; `7 k dbg_Show = split(dbg_Show,",") h8 S* E6 \5 D
( T2 N" k0 ?% Y2 J% y9 ^' \, Y& o For x = 0 to ubound(dbg_Show) 0 B; ^% R/ C( i8 K
divSet(x) = dbg_Show(x)
, @; n( [( m) W, R" _ Next
1 U) ~ Z5 w. L6 U! m e , Q, F' A# F s% w" 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 @+ Q+ C5 {! s Call PrintSummaryInfo(divSet(0))
/ a! Z* ^; |0 ^) t Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 8 Z$ u" _% K- r9 T& b# a
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
7 i$ {3 ]( U4 R) E" h Call PrintCollection("FORM", Request.Form(),divSet(3),"")
8 A# _) x. q" y( p Call PrintCookiesInfo(divSet(4))
4 }4 |. @& }# k5 w: G: b5 n 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))
7 q7 V$ c, }* m; z) k7 n5 ^( h& ? Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
+ X: w+ V% k! ~# q) e3 |4 n Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' i% \+ Y. J( [8 h% U& w8 p Call PrintDatabaseInfo(divSet(8))
) f: F& T" s1 A% E A+ A* J Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") " l( z3 @* M( ^ W# Z/ u
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") / X5 T$ o; g6 A5 f
Response.Write "</Table>"
2 x1 k1 c0 U K! z j End If ' x6 }" C# F+ d. |
End Sub </P>< >'Destructor 3 R( @# a9 L g4 y2 h
Private Sub Class_Terminate()
8 C# F4 W1 D8 `6 j7 b( N% C& e/ Q1 c Set dbg_Data = Nothing
, x, t5 ]: N: ]/ t& LEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >. m3 J0 a. `0 a& H- {9 L
CLASS debuggingConsole ; n" n. P( n& {" ]. ?0 X' T
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false ) e+ K. F' E* b5 B; L
&n1 E3 `8 J, B5 {0 [
bsp;
! q4 L9 E- z: x* f8 t: gProperty Get Enabled===[bool] Gets the "enabled" value : ^( |# q7 U" y- w5 D% t0 N
9 E% a4 V$ @9 O L4 A$ Z
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
% {$ s/ G& J) ~ S* d8 ~+ T
* X- d" h ^* U9 HProperty Get Show===[string] Gets the debugging panel. / ]. b4 f, U: _, p' k
0 H8 ?( k) R5 v& b+ N
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>< >--------------------------------------------------------------------------------
" s+ V; V. Z. _# I8 }0 Y, zPublic Methods </P>< >public sub===Print (label, output)
1 }! S3 R O$ \% S1 b, H: n/ j& ~: L Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
! `5 S5 h; d# f3 G T: b Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () $ A/ i8 ^! P ]+ f3 c% e# t
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
$ K4 k* x" M" o/ aMethods Detail 9 y$ S& _# R$ e M! \/ [# h
! y' ^, z" Q9 l j+ J+ e0 A+ X; L2 h
public sub===Print (label, output) F' h, Z; \ f. N) j- A( w& ?5 S5 Z
Parameters: 9 q4 X8 |/ s/ a" j" J
- label [string]: Description of the variable
. L/ G1 j; a- l7 L& N& @+ q$ y - output [variable]: The variable itself
, C' ]4 _0 |2 A) a/ |! v
9 m L* G: i/ ppublic sub===GrabDatabaseInfo (byval oSQLDB)
' E3 B4 X" k9 a4 ~Parameters:
; w e% {: ]2 S; A - oSQLDB [object]: connection-object</P> |
|