- 在线时间
- 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")) & ~' ^3 P! l1 C& ~% z1 ^: u
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) , w: f5 w- [+ Q
End Sub < >'*********************************************************** ^2 w$ p4 f9 X0 L: Z
'* PrintDatabaseInfo
% W- p. I% ~! \# M2 a; X0 z8 p' O'*********************************************************** " j* o% C4 T$ n* |- M1 \( D
Private Sub PrintDatabaseInfo(byval DivSetNo) 1 F. y, J; ~9 I/ B* G
dim tbl
/ A! n4 D2 h1 h8 l0 n$ A tbl = MakeTable(dbg_DB_Data) & r7 ~/ a5 H# | Z4 |' P
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 8 E3 \: g6 T- s3 I" K
Response.Write replace(tbl,"|", vbcrlf) : L8 D- a4 _' K! k& R
End Sub </P>< >'***********************************************************
& k' S. {; J0 \+ A5 j'* PrintCollection
- z0 i9 D$ m- E6 }9 G'*********************************************************** 8 `( o+ w9 l! j5 q: C e% u
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
# _# T7 ]8 m0 |# c E3 Y Dim vItem, tbl, Temp ! ~7 H4 D3 t% S7 s$ J) i+ P% G
For Each vItem In Collection ( d! Y! j& c& t* k: `& o7 r _, s7 Q
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then % y/ E6 E! a# I% R1 O% p# S
tbl = AddRow(tbl, vItem, "{object}")
" t; i* e$ l# ~: p- A) A' P5 _ elseif isnull(Collection(vItem)) then $ x! i8 q2 ~$ i' c
tbl = AddRow(tbl, vItem, "{null}")
. [- e) }. M d5 j% s; c elseif isarray(Collection(vItem)) then
1 M/ {. G4 j! _* S" r% [ tbl = AddRow(tbl, vItem, "{array}") , \# B& u1 r# q4 Z) |
else
8 Z! ~4 O# @4 e5 [6 U; G* l! i e if dbg_AllVars then
/ l: u! S6 u* e1 l8 l tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
1 s# O; X" C3 I) l4 u; D elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then * I( A+ c3 }1 r! d6 x" [+ e
if Collection(vItem) <> "" then
5 R5 _" g1 ?" Q8 [4 p: u tbl = AddRow(tbl, vItem, server.HTML
4 E" N" {! z# E& N0 TEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
! i- s7 ]3 U- G7 F% T else ' X8 Y1 r) X( u1 Y& k) s5 {, b
tbl = AddRow(tbl, vItem, "...")
7 U& T' @2 N( j end if ! P+ M v; }5 i0 w" L ]
end if
6 U) [6 q. {( Q% c1 s end if $ {5 K1 `) P j) C0 M
Next # a9 n( P, h& g8 L
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo O5 c# W/ F" l7 e& | x) x K
tbl = MakeTable(tbl) ! m4 U9 y+ J: k$ ~: h$ b: D0 i
if Collection.count <= 0 then DivSetNo =2 ( K3 u/ k" |+ C* C% r: \- W
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
+ v+ @( H' P7 R0 c& E7 @$ r tbl = replace(tbl,"#sectname#",replace(Name," ","")) , j6 d! z; J4 ^( t. D/ _% e
Response.Write replace(tbl,"|", vbcrlf)
' Z# _# ?. Z* e" w* y4 ?$ y. REnd Sub
& s, L5 }+ g J3 D6 P& R) ?
. D, F7 |5 Q! {0 n'*********************************************************** * k) x7 w1 s0 R( {
'* AddRow
- o# l$ i; q1 |9 Y' g* @'***********************************************************
9 v. Q3 w9 k( O8 f% c- FPrivate Function AddRow(byval t, byval var, byval val) 1 [. P0 m) z' X" D& }) B" ^/ ^
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 9 [, ^# d( G9 z0 ]
AddRow = t ! c7 _9 ?* }2 [- J
End Function </P>< >'*********************************************************** / A, M1 B" |9 }- h/ q, \
'* MakeTable & w$ h# q2 C. w7 ?3 O
'***********************************************************
, r8 u* @3 G4 q: @7 ~Private Function MakeTable(byval tdata)
7 v8 i0 k v% T9 K0 F s ~0 u; G tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
) G1 N# N3 t' s4 D% ]& t K0 ` MakeTable = tdata
9 }% }7 c7 U7 u! q3 _- _+ zEnd Function </P>< >'***********************************************************
. u- r. |8 l/ R( ^7 _8 d''@SDESCRIPTION: Draws the Debug-panel
7 z$ A- i$ \" i# @* v, b( S$ H'***********************************************************
9 Y3 l: S" y/ \6 I9 m1 V4 a" bPublic Sub draw() ; r! ^. u. e& q! A' y' i, `
If dbg_Enabled Then / C- x' g: M v) l
dbg_FinishTime = Now() 5 t3 n' W0 \9 z2 O1 _
; R" O5 J; y) k$ f; p
Dim DivSet, x 0 J6 T" y6 f" B
DivSet = split(dbg_Show_default,",")
& [6 V; u% ^( U& P1 c' t! z dbg_Show = split(dbg_Show,",")
, z& c! i" A( O. i/ _% `, J* R: f ) {- T- e' c- _
For x = 0 to ubound(dbg_Show)
2 s Y' h- A2 j4 ^) B* A divSet(x) = dbg_Show(x)
$ k. l/ w- x2 P7 ^+ W6 v/ M Next # g/ V" ^* V9 Y, V0 K/ ?3 l
0 O4 ?% \ q( B4 J( Q h5 Y, I2 c0 k
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>" G3 r' _3 A) G* @& R4 G
Call PrintSummaryInfo(divSet(0))
% p' p% z1 W9 y5 D Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ) p9 ~+ f* b# p' ] H* g& }
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
- Q! `9 V+ T1 j+ L Call PrintCollection("FORM", Request.Form(),divSet(3),"") 4 L$ v# d& ?9 M' A1 F" R
Call PrintCookiesInfo(divSet(4)) " O1 D, Y3 G' U$ K4 s- q9 T
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)) - M" @* w4 n. ^. k" r, w
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 0 e) D5 m9 c4 y4 r4 @: H
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
M9 Y) K- J5 {2 { Call PrintDatabaseInfo(divSet(8))
- p8 p8 a$ Z3 }! }( V Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
8 G ]" |6 I A0 W Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") ) H& O- {. ^5 V' a9 {! r5 P3 U) [2 {
Response.Write "</Table>" 1 j) H# M+ `( ^9 i
End If 8 ]1 E2 v4 W9 f9 Q1 r" M- @
End Sub </P>< >'Destructor 2 k$ |5 N# M4 G, {$ @4 e' N+ O
Private Sub Class_Terminate() ! S2 g: s) S/ z; c' D; C
Set dbg_Data = Nothing 9 W1 S* }9 r) z+ o8 M
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
8 d' w2 }% B; p/ h' [CLASS debuggingConsole
* x2 D; G# K, DVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
) `* i/ N/ ]! w0 T( `&n( O8 w# L9 d5 D% S* J3 _
bsp;
* ]2 v# p: ?2 `% L1 @Property Get Enabled===[bool] Gets the "enabled" value $ I- i8 E% _) J/ k* s. ? g& r
2 i" A- t" `3 L, a0 ^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
% ~4 c6 c6 `1 H. ?8 v
8 ]3 m# R5 J) W" k) n. i; ^Property Get Show===[string] Gets the debugging panel. # c! z9 J3 ~1 U
* r0 F3 |; f" |1 h! P: v
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>< >--------------------------------------------------------------------------------
3 q6 x: p' k; B1 M& KPublic Methods </P>< >public sub===Print (label, output) + t7 J; V( ?/ M8 C# _! Y: F4 N
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 3 D# \" i, X$ W# r; X5 b
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
& n$ p( t, u; {/ y. y Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 0 v! F' Y$ P' }: f% @" W% Y' g: b
Methods Detail
- o0 B; Y' B' w U- k
8 S, X( P- J+ P0 N( Ypublic sub===Print (label, output)
0 X) X& j! r# A$ }5 o* hParameters: 0 u% S# r4 W+ r6 Z" g6 I$ J& a
- label [string]: Description of the variable
( A* A! v& U/ B. C - output [variable]: The variable itself
1 b% Z- ]+ z' T/ ]9 d 8 j$ G) b2 J; n7 o6 x
public sub===GrabDatabaseInfo (byval oSQLDB) j# R, f- ?% K% N+ Y* ]
Parameters: " c' K( _8 t$ ~
- oSQLDB [object]: connection-object</P> |
|