- 在线时间
- 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"))
' J% F/ `$ U# h) e0 E2 O+ W9 b dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
1 Q9 \$ V( f8 I |7 v; Q8 T2 t: J0 IEnd Sub < >'*********************************************************** + D: \7 V2 j8 Q5 q
'* PrintDatabaseInfo 8 `* O5 r$ I/ B( N( ~6 d! d4 x5 y
'***********************************************************
7 Y/ h( H" k: S, zPrivate Sub PrintDatabaseInfo(byval DivSetNo) + \- y6 _$ \/ n7 ?- z
dim tbl ( M, x1 B( S8 m" x% Y4 f
tbl = MakeTable(dbg_DB_Data)
8 Z, g3 S+ F2 R9 d: a3 |; Y tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
/ S/ M, [) a9 k, C9 ^ Response.Write replace(tbl,"|", vbcrlf)
9 n, w: |9 o# REnd Sub </P>< >'*********************************************************** 5 y( E M' X2 b
'* PrintCollection
0 _) ?9 ^; ]% o- G) H'*********************************************************** ; S3 b5 Z) V8 `
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
- \: q g$ l" x$ B Dim vItem, tbl, Temp + b. w$ V2 p" E9 q M* v8 M$ Y
For Each vItem In Collection 3 h# D! n# ~* g, B
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 6 h9 |, @+ [, ^( k4 m/ C, | Y) i
tbl = AddRow(tbl, vItem, "{object}")
* U5 d8 C5 r) C ~; D elseif isnull(Collection(vItem)) then 2 q: ?' y: L7 P8 x
tbl = AddRow(tbl, vItem, "{null}")
6 V' K6 T4 P: O# \! c% T7 u elseif isarray(Collection(vItem)) then ' m5 X# k& p- _- r+ E
tbl = AddRow(tbl, vItem, "{array}")
5 i- J( A/ f, w8 [( y y else
/ n; _, E ?) h. ?) }* n: y' H if dbg_AllVars then
2 v+ A; I$ R6 a* B7 p1 G* m. W$ j9 \ tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
0 o I) h; u' Y. H: @ elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
; I. _ P: ?: \2 y" n3 ~4 H if Collection(vItem) <> "" then
' ]5 M$ [2 h4 O+ m, W tbl = AddRow(tbl, vItem, server.HTML% a( V& k9 h5 j
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
$ ]* o8 T$ c! _& S3 v9 u else & I' ?7 B: d, d; y
tbl = AddRow(tbl, vItem, "...") % n) F) Y4 R. Z* [8 |; [
end if
# P/ q, s: Z* l9 a G1 |2 q/ d end if % I5 \7 L* y6 p3 B; x% X
end if " Q, Y) h# a, I
Next
6 N/ _/ Y9 c# Y if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
3 x1 w$ h" w8 ?5 N. x! p tbl = MakeTable(tbl) " e" |; l2 G( G+ P5 G( m3 u
if Collection.count <= 0 then DivSetNo =2
5 U" E; `$ B* Y: B5 n tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
) y& B# m, e) ?) y" X tbl = replace(tbl,"#sectname#",replace(Name," ",""))
$ Z! X' }2 a0 r/ N) j6 E. @0 H: } Response.Write replace(tbl,"|", vbcrlf)
" F# M7 b s3 a6 qEnd Sub
m% e: U3 y$ z7 L
# M: M' ~4 ~+ q( ?4 h'*********************************************************** 9 L9 k& o- X5 S
'* AddRow
( H; E6 J' g1 w2 W'*********************************************************** 6 K" D* t4 d9 U4 N
Private Function AddRow(byval t, byval var, byval val)
$ N! `6 x( x9 x. W, U t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
0 F* I$ i+ i; W' N+ S4 H AddRow = t
' o1 b7 C/ ^6 NEnd Function </P>< >'*********************************************************** " q2 ], T9 m# W
'* MakeTable 1 x' { m# w- d9 ]" P8 Y
'*********************************************************** 9 b5 z& m6 e! T) [; ~2 h; o. C
Private Function MakeTable(byval tdata)
- O" l5 }' J2 V+ D8 ? tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
. \. Z0 K$ l4 x- M MakeTable = tdata
. P; a0 ?6 g& f$ d- E: eEnd Function </P>< >'***********************************************************
0 e$ n) e$ \0 d3 o5 Y p# t+ X''@SDESCRIPTION: Draws the Debug-panel
7 R. l! p; E# j, D8 ?, f'*********************************************************** & c) m6 y \. M* t- z
Public Sub draw()
& z% |4 B9 K! i$ i# S& ~ If dbg_Enabled Then 0 p5 S' I4 {# A. j$ g+ e
dbg_FinishTime = Now()
M" B& D/ \1 f# q2 a , H8 Q* K) k0 C5 s" i. S/ ?) _4 N
Dim DivSet, x
, b5 |% q( T2 a! E& u1 x* @! {9 P DivSet = split(dbg_Show_default,",") * g- R5 I+ T) |5 c
dbg_Show = split(dbg_Show,",")
! y! n9 V/ _% s: S* R2 H
: c- A0 V- ? ?/ M$ V" F l For x = 0 to ubound(dbg_Show) [) O0 c: G! _! P
divSet(x) = dbg_Show(x)
- p9 @2 {& A2 U/ z( x Next 1 K6 n: n! s& u
, \0 F9 D3 }% K/ H" N8 C4 M
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>" 7 A: F7 \/ |+ {; I ?
Call PrintSummaryInfo(divSet(0)) / k; _% @% D& S
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
+ D$ X9 U* z( p; i Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") & ?2 p8 R$ b& H1 C" x! i
Call PrintCollection("FORM", Request.Form(),divSet(3),"") # }$ j$ c# p7 n2 ], } B
Call PrintCookiesInfo(divSet(4))
, E4 e; r8 A+ ?8 r 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))
) X3 V& k5 l% U Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
' v0 i4 j& w k2 ` Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 4 B; S& x% Y, D5 o# n& j5 B1 q' T
Call PrintDatabaseInfo(divSet(8))
6 P& e# f# L. q, k: u7 c Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
- w1 i4 l8 g5 v3 h4 |0 ^ Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") . H. _) q# F* D9 w/ t
Response.Write "</Table>"
, C# ~" }6 P$ e0 T5 | End If
+ o0 W! ^! O' u9 e2 J( V" l7 p) D% y0 s' HEnd Sub </P>< >'Destructor 2 x8 [ l3 [: G4 B+ A1 R T9 n
Private Sub Class_Terminate()
. Q( P8 B6 i, X4 G" y* { Set dbg_Data = Nothing + x- X9 t% d5 O* x
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >- f% N- c+ N6 U
CLASS debuggingConsole
% f' i( h4 B8 ?/ d- j& @: K4 QVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 6 x( ]1 g$ |# _& m6 K5 @9 {6 }
&n
/ o7 B5 X7 I0 o7 J# Ebsp;
# ^4 ]4 T3 v4 s" RProperty Get Enabled===[bool] Gets the "enabled" value
& g8 y9 ]" ]/ v+ }
+ x, E6 _( }" `7 N2 Q I) tProperty 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 * W: Q, k: j% z) J5 l
4 F$ K$ i0 W [2 l9 O, S! _Property Get Show===[string] Gets the debugging panel. : h9 d T" r, Y( k
* H3 `" L- I5 q" w$ l" D" V9 [# UProperty 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>< >-------------------------------------------------------------------------------- / P3 \% j6 ?. X; L* T- \
Public Methods </P>< >public sub===Print (label, output)
0 V6 j. P6 T4 P Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
, x# E$ J2 G0 k1 g6 J. b" i4 ? z Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () ! v: e2 [+ G* h& a4 n
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- Y; F+ D( l! L( d
Methods Detail
$ H% M2 `( `0 }; _ % @9 C% r% X. A; o: A$ F+ Y, i
public sub===Print (label, output)
) a# n* b& [1 j; B" A% ^9 RParameters: 9 m, c! t5 r5 N' Y( Y/ K4 X" ^
- label [string]: Description of the variable
+ x1 u0 G8 @. J, W& Z7 _* e2 E - output [variable]: The variable itself
* J' i$ Q' ~( F" a: `8 \0 G' t9 t
0 x0 y5 N: U, C1 |" Npublic sub===GrabDatabaseInfo (byval oSQLDB) ' Y# g# q; w+ Z. D* i3 O+ w$ t1 M
Parameters: + Y) w1 M0 \1 n6 {% {# `% i
- oSQLDB [object]: connection-object</P> |
|