- 在线时间
- 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"))
# b% d) m" w" u4 f% a) y z dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) 2 A, u$ U$ q( ^
End Sub < >'***********************************************************
9 b8 N( ~. A% U/ c) C'* PrintDatabaseInfo
u! p' w# z9 L5 a'***********************************************************
8 N) g' @( k# A$ vPrivate Sub PrintDatabaseInfo(byval DivSetNo) 3 V+ b7 t# m' E. Z+ R# G
dim tbl 2 t" q" k% S0 f' y) c
tbl = MakeTable(dbg_DB_Data) % x& J! |# Q: z! E4 O$ u. n6 c
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 8 _, d; W8 Q: U2 Z! N/ U) o
Response.Write replace(tbl,"|", vbcrlf) / a: T/ B1 \# q2 L& q' k( J
End Sub </P>< >'***********************************************************
; u% k3 J! f9 l'* PrintCollection + @3 s: j1 t4 u, S9 b' |
'***********************************************************
2 k' O( u4 M$ e8 wPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) . h: {1 [6 |" {9 H0 B5 } ?
Dim vItem, tbl, Temp 2 K# d( Z5 i5 A9 y) E2 y2 F, }
For Each vItem In Collection 1 |% u" I2 o# k' J
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
2 l# P: d9 Q' \4 P/ Q3 [4 |7 w tbl = AddRow(tbl, vItem, "{object}") * ~$ r$ \3 N3 _. P
elseif isnull(Collection(vItem)) then
: I& r: C$ W: w' S* u" Q/ X3 l/ ^( v4 { tbl = AddRow(tbl, vItem, "{null}")
* y, P9 a9 {% o! h elseif isarray(Collection(vItem)) then
; p' j, Z# ?$ V4 W1 h- N9 h tbl = AddRow(tbl, vItem, "{array}")
& C+ g0 P8 w. J else 8 q" X) `8 w: N: G9 d$ R+ [
if dbg_AllVars then
1 s3 d3 L9 O1 F& Y+ A9 a2 _( m! T tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
* M1 ?1 ?+ K" j2 n: z! | elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
1 K- v) w" g! X; b; f if Collection(vItem) <> "" then
1 Z1 o" ^" \, c% U) o. t) @0 J tbl = AddRow(tbl, vItem, server.HTML
5 y( r8 |8 X* Y& h9 a6 Y0 x' sEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 8 y- F5 A* M2 T1 n2 r' I
else 5 L7 H# q% N0 Q1 }5 g1 i& z {
tbl = AddRow(tbl, vItem, "...")
; ]- {: }: J& }+ _7 L# w3 w end if
' U* w5 z+ a: |/ }# N$ { end if
+ K' L- z9 |2 g: r end if , U8 E: Y0 @3 N
Next
6 v. _& Q S9 {% p* n; | if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
7 @) Y( G7 f' ] H l* o, ~7 H tbl = MakeTable(tbl)
: h$ d1 ?. Z" N) Y7 ] if Collection.count <= 0 then DivSetNo =2 9 _, g" \, I! p4 j9 u
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
- r* c) Y' o$ b tbl = replace(tbl,"#sectname#",replace(Name," ","")) " o; h! X: w- o" H) @- `
Response.Write replace(tbl,"|", vbcrlf) % y, K1 ~. V6 }- `, E; K
End Sub : V+ g* ?/ M5 @: j2 @* Y
9 X1 |3 c* n$ n7 d0 L
'*********************************************************** 0 w" C# k2 A3 c5 {
'* AddRow ) C( j/ u( q" ?
'***********************************************************
2 ]5 j7 W: p- u3 \Private Function AddRow(byval t, byval var, byval val)
o O) E9 M1 ~ t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 6 v3 Q$ \" L+ s1 B
AddRow = t + j# L) [2 N0 Y6 d
End Function </P>< >'***********************************************************
; W6 l* F. K- p) C: y, ^8 v& f'* MakeTable
, s( `' W& |" S+ `$ U4 ?1 V'***********************************************************
. y7 v" [8 R% Y9 @; z, Q$ Z; FPrivate Function MakeTable(byval tdata) / }& [: l$ y1 r) f( V" g
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" % Z! A0 S8 P3 i9 W) N
MakeTable = tdata # G' I* b3 T5 b5 {' o2 m
End Function </P>< >'*********************************************************** $ Y1 E4 Z" \6 l
''@SDESCRIPTION: Draws the Debug-panel
1 ?0 a) K+ X* Q'***********************************************************
$ W: `& E7 O! Q$ MPublic Sub draw() + o* `/ R! N$ [$ a/ w4 ]
If dbg_Enabled Then
" Z _& `. v F1 L/ u% l; Y dbg_FinishTime = Now() 0 z0 |9 e8 {8 S6 _! t
8 ]& u! j* w) y) }( g5 ]2 g
Dim DivSet, x
& |7 G' Z! m" D# \ DivSet = split(dbg_Show_default,",") , B9 x& E* ~3 |9 L. S
dbg_Show = split(dbg_Show,",") 9 D) I% B( x6 Q" M% L9 Y
! z. z9 t X h For x = 0 to ubound(dbg_Show)
6 r. I% d5 A l divSet(x) = dbg_Show(x) ! L/ f! @ u+ v2 G4 B; k
Next ; v, F5 U% J* l
7 i n+ A1 M2 }5 s. M( u 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>" N" q* R* b, Z8 w* X0 Q) s
Call PrintSummaryInfo(divSet(0)) " X4 E& M9 v y) I
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ( Z6 Z+ M5 c( F& Q
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
! W" q4 `8 j0 h Call PrintCollection("FORM", Request.Form(),divSet(3),"") * C i! V5 t% ^8 B [0 E+ j% K
Call PrintCookiesInfo(divSet(4)) % z- w6 C& O" E3 I7 Y% |0 B
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)) D* T2 q2 C) Q
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
: P* `# ]9 h* N/ X Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) # n3 K# q5 |! \6 |
Call PrintDatabaseInfo(divSet(8))
. p7 W) m& ^& n9 v( M& i9 e% V0 p Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") & s( o; E6 W7 G4 c U
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
& f0 A+ W3 M/ C( m- } Response.Write "</Table>"
1 S' K9 L: ]) B End If 4 M* A) \' r: j* l: u/ C
End Sub </P>< >'Destructor 8 R( v+ T2 S) n. h: L7 N
Private Sub Class_Terminate() / [' x3 P2 B9 P8 O
Set dbg_Data = Nothing
% b- K* K& b5 l! ]7 MEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
/ D! Z, l r3 o, [* [$ SCLASS debuggingConsole
- _4 W! V& C6 U% qVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false $ ?! u- k/ G# h! }+ Q( J3 J
&n9 H ~3 t4 m$ v$ D3 G
bsp; ' I! \7 @& _6 h; H2 }/ X' G
Property Get Enabled===[bool] Gets the "enabled" value 2 E: r; n+ _ k t3 Q! B9 |
) o4 d, R D2 W# C. ~3 _1 MProperty 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
+ x# z+ U: J+ [, r0 H
; Q' K9 P5 x2 ]* GProperty Get Show===[string] Gets the debugging panel.
" M, v9 v8 T# Q4 k `9 o6 a6 ?3 ] 3 s6 V' a( k$ h g( y g. _
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>< >-------------------------------------------------------------------------------- 8 {3 H- X2 U f) G
Public Methods </P>< >public sub===Print (label, output)
: g) z- v7 e# B4 j" J9 Q Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
* v1 `. u$ T5 `! M2 o Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
% V* W; L% g, Z7 D+ @8 ^, |! r Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- - e9 m! L$ Y! g! ~
Methods Detail # C: A1 c- E$ H6 c
6 H; E9 u' B, P8 P8 U# I5 u
public sub===Print (label, output)
6 Q7 A! I+ f. A" [' B. q: lParameters:
O& f {6 s: x& k( ` ` - label [string]: Description of the variable ( A% I3 t0 R7 B+ m
- output [variable]: The variable itself * Z& T1 S8 C6 J0 ~: x2 \
9 V! o/ o9 v- p% ~4 Ppublic sub===GrabDatabaseInfo (byval oSQLDB) 6 h, l7 _ ]# V. g: i
Parameters:
5 X, A0 Y4 R$ d2 s7 m - oSQLDB [object]: connection-object</P> |
|