- 在线时间
- 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"))
# @; e' p% @6 R7 j5 z% S% h dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
. n3 _* g/ s4 b+ ~: M4 j7 vEnd Sub < >'***********************************************************
; T7 ]9 l: p& x$ Y'* PrintDatabaseInfo
: ?* L4 u* A+ }* Q'*********************************************************** 3 \% M: N. O3 C# c; f
Private Sub PrintDatabaseInfo(byval DivSetNo)
+ Q. y1 w: [6 @) E1 r- `# `- q dim tbl 3 W$ g8 H" {9 L% m
tbl = MakeTable(dbg_DB_Data) 8 G/ E# D3 ^ U) B/ @' v& J' a
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 3 E# ?$ B( V2 P1 q
Response.Write replace(tbl,"|", vbcrlf)
" r* w8 ~( t+ C, _4 _* k6 {. CEnd Sub </P>< >'*********************************************************** 0 y+ Z3 _9 u- E* j5 k3 i
'* PrintCollection $ U: n, k0 h3 @8 {1 j6 P
'***********************************************************
+ q. G( A; b4 K, R' e1 f1 p: ?Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
/ i: p5 ]# z/ U Dim vItem, tbl, Temp
* H& M, p5 P8 c For Each vItem In Collection * W+ v0 R5 r/ j% i) j2 ]0 Z+ U
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
+ {6 ~7 @- x# N8 i tbl = AddRow(tbl, vItem, "{object}")
* w, M6 R* w. p3 L! g2 V elseif isnull(Collection(vItem)) then ) h! I" L9 u/ S5 d
tbl = AddRow(tbl, vItem, "{null}")
) b" u+ _0 _/ v4 _+ F% }5 F+ j elseif isarray(Collection(vItem)) then
$ e7 I5 b! @9 T4 o& q* b* g tbl = AddRow(tbl, vItem, "{array}")
# z' G! o. E, t$ y9 P' H else
& G, i6 t0 {& V$ } if dbg_AllVars then
# Z' L* k) Q, H6 P1 c, u& k tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 7 w0 d% ~: O$ A1 i, V- u: L
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 6 g, ^% H/ ^% l- ]) O5 G
if Collection(vItem) <> "" then ! p( P9 v3 u) o( c
tbl = AddRow(tbl, vItem, server.HTML
% C- [( n5 ^7 d( A2 T. v1 ^Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") , R( h* h4 U& P+ e, h0 }) {% e4 i
else % Z( s2 z6 A1 @$ q# c
tbl = AddRow(tbl, vItem, "...") % r$ c* T+ T+ z
end if 3 S5 \6 m+ ^4 J {
end if
1 r/ y- y7 [" o0 J; M# f l& @ end if
" E7 P5 A! v5 u) B8 n3 Z Next
" t \7 N s6 Y" a6 T) B. \ if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
% I p1 P H2 k1 t) I0 w tbl = MakeTable(tbl) $ K/ A+ J$ _8 R, L. m
if Collection.count <= 0 then DivSetNo =2 0 H2 V( s$ g7 N w/ c9 u% I( h( ?
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) + O- u. h8 e: |& a$ i5 o) x7 H
tbl = replace(tbl,"#sectname#",replace(Name," ","")) % j5 e! ]4 ^0 z, h5 }; o
Response.Write replace(tbl,"|", vbcrlf)
8 ]" H8 {0 m, h7 x: ?+ l- v% F2 ^End Sub 6 g1 m2 ^0 D0 e; a
6 [* u, ?+ Z% W- W! [' ~: h
'*********************************************************** % A2 s/ K+ _* d; b
'* AddRow
}8 U- ?5 ~# \% x; t& |7 k'***********************************************************
( F; l! i1 O/ `" `Private Function AddRow(byval t, byval var, byval val) - S. `. ~3 y8 i" y
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
+ F7 ~# D0 i! G3 N' R" Y' {, D" d! S AddRow = t 8 z) k% X' e: l# I7 [% r
End Function </P>< >'***********************************************************
/ d9 m7 [0 Q$ t5 ?" {7 I6 L. ?1 n) o'* MakeTable 3 b" c# m8 F% g& s# k& z4 _# @
'*********************************************************** * f# b! {+ H6 S$ e
Private Function MakeTable(byval tdata) 9 r) M( |0 ]8 H6 R1 I
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" + G: Y& \) c$ h7 {3 m
MakeTable = tdata 5 j8 q' b {$ s3 |5 ?
End Function </P>< >'*********************************************************** 9 V/ t' d/ B$ `# h
''@SDESCRIPTION: Draws the Debug-panel
6 ^; p. c( C; d4 ?: P. N/ m- S'***********************************************************
5 H7 t$ @& c. h& B& N. XPublic Sub draw() ! R; u. N/ J [4 I5 \
If dbg_Enabled Then - u1 u/ f: A( m7 E: v' q/ H* I
dbg_FinishTime = Now()
1 Y `" G* `7 r7 m * A- L6 M& n9 h' `7 C# j! s/ A/ z3 x6 X
Dim DivSet, x }* \0 h' U+ m& e* t! O3 P* [ r# E
DivSet = split(dbg_Show_default,",") 4 S0 b" k0 ^0 e# e( f- H
dbg_Show = split(dbg_Show,",") . `5 a/ C5 q2 z6 { n
% }) N6 S8 P* v9 O) V
For x = 0 to ubound(dbg_Show)
+ L% |/ o \4 _) D! i0 d divSet(x) = dbg_Show(x) , _; ~9 J1 z, K
Next ! `, M* o, l! V" K# u
* e0 Q U/ @/ a% {/ r% t a/ f 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>" , Q" ^& F8 T$ [# H
Call PrintSummaryInfo(divSet(0))
% A$ k& l1 _, W4 j7 k, f Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ! }% S' I, c# d- {- x! p
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ) }+ A: A, w) x" B( r u
Call PrintCollection("FORM", Request.Form(),divSet(3),"") 3 R* n, X/ A! V( R
Call PrintCookiesInfo(divSet(4)) 1 U6 w% y2 x- `7 A
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 Q0 J3 [7 }; u4 y Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
8 S: t% m9 p& ~# ?& @ Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
: ]7 g* i7 z% U; v% U+ Z Call PrintDatabaseInfo(divSet(8))
- A; _" L8 T- I. F Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
# o! N' v9 z' `: d" Y- W" ^ Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") f, k1 [0 R+ [- l
Response.Write "</Table>"
2 F- C- w! b1 L# A1 T0 d+ r4 Q0 b# u4 c5 V End If
7 e, C, k6 ^ V! _+ HEnd Sub </P>< >'Destructor
/ E$ z% T* v* k+ ]Private Sub Class_Terminate()
7 k* O6 z9 W" B' w: t Set dbg_Data = Nothing
5 `+ ?' o0 b: I% K4 P6 M5 I5 @+ MEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
7 q8 z5 {( z: [1 jCLASS debuggingConsole
! m& ~1 c+ {$ H3 `- D% E1 `4 BVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 7 v. f% D1 @: E9 h. m) u
&n6 n0 ^: Z) {7 v3 F! W1 i2 }$ A
bsp;
/ T! g9 Q8 n2 p6 K, RProperty Get Enabled===[bool] Gets the "enabled" value
. T* y/ Y2 Y- W: O5 {
: D( x* P. q1 ]9 VProperty 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
& p7 D! `$ D4 V- \- n" g) I
! [" y% M" f! b+ Q' ^/ Q& y8 qProperty Get Show===[string] Gets the debugging panel. # o- O$ J' D2 g
* N. d+ J8 ]0 e
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>< >--------------------------------------------------------------------------------
5 X+ w9 M% u3 b) k5 f+ mPublic Methods </P>< >public sub===Print (label, output)
( u9 W, \: E7 k9 E! i( S) [. V Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) : A( a# D0 j5 w' d; a
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () / } i' w6 q+ G" o9 ^* l
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
+ n2 `! r- ?: i( p; i5 e5 UMethods Detail + }" `4 L: C: C* H% Y4 x: E6 I
" k$ W' h; s& ]) |public sub===Print (label, output)
( q8 E1 G7 r. b, w( _Parameters: ' Y% k/ d2 B! V. n
- label [string]: Description of the variable
, z3 k; Y, A* w2 y' M) q - output [variable]: The variable itself : O0 ^! N6 U+ N! g' Y4 |3 S- ]5 k- ^% b
9 ^2 [+ L7 g2 T! A! u/ |( qpublic sub===GrabDatabaseInfo (byval oSQLDB)
, R+ @3 S* f4 @ J. r; O6 A' U# ZParameters: 9 A( ^1 I: W2 B3 s9 b0 k
- oSQLDB [object]: connection-object</P> |
|