QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 6461|回复: 1
打印 上一主题 下一主题

ASP中令人震撼的Debug类(VBScript)

[复制链接]
字体大小: 正常 放大
韩冰        

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
8 F, X8 x5 U, H. ^8 K; h4 L$ k3 r<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
6 I7 {  n* v; h) d% X使用方法很简单:
9 W& S$ m/ U3 d/ }test.asp </P>
7 |8 B0 D: E9 N1 D<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
* f3 \7 R; y& y&lt;% 9 O2 t/ ?, `. F1 Q$ y! e$ H
output="XXXX"
6 @/ l6 |+ d! G! zSet debugstr = New debuggingConsole # z, R) g, n$ e! I
debugstr.Enabled = true 6 C4 u7 c. {7 b! [4 ]3 E% I/ }
   debugstr.Print "参数output的值", output
) l4 W/ ~: k8 @0 g( X7 g( k   '…… " u" P8 N/ U2 R
   debugstr.draw
) y6 L0 T  N* F# Y6 l  ]$ f" USet debugstr = Nothing
8 m+ l; k3 c7 A' w. b0 m( b%&gt; </P>
) X/ f- B4 v0 e6 s1 \% P+ v. L5 f<>=================================================== </P>
& j, ~+ ^8 X8 e# W. T<>debuggingConsole.asp </P>1 p" @0 y! _+ r0 k
<>&lt;% 4 b, o( y6 U) [- L# t' N
Class debuggingConsole </P>
& y1 D7 S& [- v3 w9 s3 X, P; C<>   private dbg_Enabled
3 f' O! y" G3 K1 [+ T" {   private dbg_Show * I1 D+ l) q* G2 V* s. f1 W3 d
   private dbg_RequestTime 2 E9 ]% L% u+ V/ k+ N
   private dbg_FinishTime
- f! j+ C" @6 g" m   private dbg_Data
# Q4 H, @( `  R  ^2 {2 p+ G( k   private dbg_DB_Data
( k) L' }, Z( p& y. s4 @) j   private dbg_AllVars
6 M) e9 c9 f2 `: n' O   private dbg_Show_default
/ q# C2 d2 B! }/ n4 F   private DivSets(2)
7 D% Z3 m- b- Z% Q# w: a- q   
7 I4 F, c5 ]7 I  o! a1 W0 H% c5 @* y'Construktor =&gt; set the default values + X; i" F9 J( q( m
Private Sub Class_Initialize() 9 S9 k0 s% J* E! S4 D$ g! ?4 Z
   dbg_RequestTime = Now() " `4 a( D1 J/ Q. C- P
   dbg_AllVars = false : _4 w% X4 Q! q0 P) c+ E% y( g: D
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
/ U( [% j3 W9 U<>DivSets(0) = "&lt;TR&gt;&lt;TD style='cursor:hand;' onclick=""javascript:if (document.getElementById('data#sectname#').style.display=='none'){document.getElementById('data#sectname#').style.display='block';}else{document.getElementById('data#sectname#').style.display='none';}""&gt;&lt;DIV id=sect#sectname# style=""font-weight:bold;cursor:hand;background:#7EA5D7;color:white;padding-left:4;padding-right:4;padding-bottom:2;""&gt;|#title#| &lt;DIV id=data#sectname# style=""cursor:text;display:none;background:#FFFFFF;padding-left:8;"" onclick=""window.event.cancelBubble = true;""&gt;|#data#| &lt;/DIV&gt;|&lt;/DIV&gt;|" </P>
4 G3 [/ }7 R, Y/ Z$ U. L8 a: e0 c4 I' R: E<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;$ I+ M3 s9 ]1 B! c8 g5 u( E
&lt;DIV id=sect#sectname# style=""font-weight:bold;cursor:hand;background:#7EA5D7;color:white;padding-left:4;padding-right:4;padding-bottom:2;"" onclick=""javascript:if (document.getElementById('data#sectname#').style.display=='none'){document.getElementById('data#sectname#').style.display='block';}else{document.getElementById('data#sectname#').style.display='none';}""&gt;|#title#| &lt;DIV id=data#sectname# style=""cursor:text;display:block;background:#FFFFFF;padding-left:8;"" onclick=""window.event.cancelBubble = true;""&gt;|#data#| &lt;/DIV&gt;|&lt;/DIV&gt;|" </P>
- Z$ a& N+ ~7 _) I# L. Y<>   DivSets(2) = "&lt;TR&gt;&lt;TD&gt;&lt;DIV id=sect#sectname# style=""background:#7EA5D7;color:lightsteelblue;padding-left:4;padding-right:4;padding-bottom:2;""&gt;|#title#| &lt;DIV id=data#sectname# style=""display:none;background:lightsteelblue;padding-left:8""&gt;|#data#| &lt;/DIV&gt;|&lt;/DIV&gt;|" </P>
- f- ^6 E- p2 v<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ) S) p4 j0 O1 u. M$ f3 ~& t& p7 x
End Sub </P>
) U! C+ _% t* x/ J4 }' _, e: L0 R<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
/ R1 \$ d2 M- _  B& i  {4 ^   dbg_Enabled = bNewValue
; P+ Q$ A6 Y1 f& m) K# q& V' vEnd Property </P>
- y4 Q/ B* d' [1 ^! F* V$ b4 @! a<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
1 U4 U( {3 F2 O   Enabled = dbg_Enabled # A* z1 U6 I; I( E5 n7 O) Z
End Property </P>/ U- @( g. t8 M! S$ V
<>ublic 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
! G- f& }( p; B% T! u: V" ?   dbg_Show = bNewValue ! d6 @" o* k8 C% f
End Property </P>+ `, H% P3 R- a: C+ {$ R% o
<>ublic Property Get Show ''[string] Gets the debugging panel.
  V# E; H* n" w; |# @   Show = dbg_Show
& w5 T1 p, O8 Y4 I3 _, x. DEnd Property </P>
7 Z& U$ q. j5 G) S$ ~* T$ W$ u7 P<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
* J3 N* A1 Y  ]& @' ?   dbg_AllVars = bNewValue   p: U! G; P% E
End Property </P>
& A7 F( H& N( J8 L0 V<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
4 r0 Z1 E: f: D- ~  \3 _/ x   AllVars = dbg_AllVars
7 {0 ~, a0 ^5 }4 h2 gEnd Property </P>
4 s  \' z. N1 S. Y! V<>'***********************************************************
1 v% K0 Y8 f5 f9 M''@SDESCRIPTION: Adds a variable to the debug-informations.
+ E+ g0 f& \* }) b''@PARAM:  - label [string]: Description of the variable
( R: D' g1 X0 p) N''@PARAM:  - output [variable]: The variable itself
6 Q6 \' n' Q9 Y'***********************************************************
. F( z7 U$ |3 e! e  |4 zPublic Sub Print(label, output)
! D* b+ ]% U! I! j, \8 `0 ]0 T* w   If dbg_Enabled Then
% g+ G( @( g0 W- w     if err.number &gt; 0 then
- ~5 I- w6 K# z       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 4 v: U1 e( c; t( w: ~, @; @
       err.Clear
4 C0 i0 P( @& h5 P2 S* \     else 3 U0 r& d' w* R7 I8 N" Q
       uniqueID = ValidLabel(label) 3 W$ ]" X0 U8 I" S; P
       response.write uniqueID " A! J/ b# z' [! V6 o6 S3 @8 L
       call dbg_Data.Add(uniqueID, output)
- N/ i) ^. X3 P1 A0 k( f- e     end if
* D$ E1 A* K* Z) I7 J( ^& r' {   End If
: R+ W- J2 i- f) p9 ]' ?End Sub 9 P. p4 A, _8 d% |. U9 {' w
  
+ l  U5 O8 V3 Y, |'*********************************************************** 5 `  \+ J6 Y) b7 Y4 d8 s
'* ValidLabel 5 f8 X8 o, g( y$ R: a
'***********************************************************
+ @9 e; m6 f& HPrivate Function ValidLabel(byval label)   Q2 @' \. ~3 Z# R. @$ P
   dim i, lbl / t7 u; i: T$ [6 S2 d8 f4 P3 D, ]
   i = 0 ( @" ~( E# r: p$ N% D
   lbl = label
, e# i2 z4 l1 z   do * V0 M/ Z# s8 L0 s/ K, L
   if not dbg_Data.Exists(lbl) then exit do - j" P5 w& V0 V* P$ G( V% V$ S
   i = i + 1 ( P/ g6 v6 K1 H4 u9 `  c
   lbl = label &amp; "(" &amp; i &amp; ")" 4 k  T% I* _) X1 Y0 e
   loop until i = i % b& S; W8 y" ?" b: w; Y. }4 m
  
$ L; u+ G7 p, a; z2 F) m   ValidLabel = lbl . V6 A6 N4 \+ c! L' f
End Function ( h8 R. r- Y: c- e+ g
  ; ~5 p3 S  K0 M3 F7 d7 r* ~* J
'*********************************************************** ! D7 ]% d/ M" o* h4 S
'* PrintCookiesInfo
3 \. P' F5 ~; h( E'*********************************************************** 6 }4 @1 v1 _& C! q0 T1 l  O" ~
Private Sub PrintCookiesInfo(byval DivSetNo)
2 Z& y: J. G4 v) i( j3 W, x   dim tbl, cookie, key, tmp 2 V2 y4 C* I/ U8 t6 g5 t; [  T! Q8 J
   For Each cookie in Request.Cookies ) @" U1 `3 I2 m% V: C8 Z
   If Not Request.Cookies(cookie).HasKeys Then
/ |$ J% B3 j2 {     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   5 }- f3 O) I$ k% E) w2 e# H6 j7 M
   Else ! d, e) }% d: q! ?1 a) V6 k7 [1 X
     For Each key in Request.Cookies(cookie) ) {( Y' e& F2 |
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
7 |% r6 s5 g6 q' A7 oCookies(cookie)(key))   
* t. S5 o2 F4 ]. l' v: R9 x   Next
* t% A: D9 G% n$ Z; n   End If
  _- A1 L$ g( z% c& X   Next </P>. T0 d$ w$ H+ }1 D8 o( N: k
<>   tbl = MakeTable(tbl)
3 S# K/ Z+ t# d' ]; S3 O; M8 O6 `   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 # A0 J5 Q, w1 u, R
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
* b' y3 U9 O4 v" \* k' A: W3 `   Response.Write replace(tmp,"|", vbcrlf)
- D- [& {' y$ T( O- B9 fend sub
& I4 d5 Z/ u+ d  
3 a, V+ ^0 v6 C& g/ K'*********************************************************** 5 ^" Y0 B- Q) r. D9 c/ g" o
'* PrintSummaryInfo 6 Y% {( n7 V- ]$ D, l# ^: {  H5 \
'*********************************************************** & g. m! K2 }4 w) q# b
Private Sub PrintSummaryInfo(byval DivSetNo)
% k$ R( D) S/ {' x   dim tmp, tbl ( y* G, u) A3 K, n1 y  J( h# x
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)   V- _9 C/ Y: ^# P  r
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
: v% {# i4 s* _! T5 C5 s4 p8 S   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
' `) Y0 D/ Q6 U- s   tbl = AddRow(tbl, "Status Code",Response.Status)
- x2 l- X8 q& x/ S   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) 3 C3 k1 z" R2 u# s
   tbl = MakeTable(tbl)
+ l. m# L+ \% J* }   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
% q* N( w& ~+ Q8 T- u   Response.Write replace(tmp,"|", vbcrlf)
( s3 p- c% }1 s2 j0 hEnd Sub </P>
& z) R  q, M( q<>'*********************************************************** " e, s  Y7 j& {' C; P3 e0 H5 q
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
' z1 E: {# B% h9 @# Z7 [''@PARAM:  - oSQLDB [object]: connection-object 1 F" O; ?* W9 q5 P. C
'*********************************************************** 6 k+ [1 M6 M6 B; G( ?" f
Public Sub GrabDatabaseInfo(byval oSQLDB)
, L1 ?! Q7 V2 s4 R: r   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 9 ]: s+ v7 n# u% p1 u+ S
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
! O+ d( u% P( B+ ]" m   dbg_DB_Data = AddRow</P>
zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持1 反对反对0 微信微信
韩冰        

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

(dbg_DB_Data, "DBMS",oSQLDB.Properties("DBMS Name") &amp; " Ver: " &amp; oSQLDB.Properties("DBMS Version")) 5 ^3 V2 s5 ~' W$ M( {
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
; i* G/ ~& X- REnd Sub <>'*********************************************************** $ c" [" y4 L, F  h  ]
'* PrintDatabaseInfo ) F- r' k6 t# Q
'***********************************************************
8 Z) y0 I% X- }' E) E; g* v! V& ZPrivate Sub PrintDatabaseInfo(byval DivSetNo)
7 a- |; h( H* t& Q2 G* x) K- T   dim tbl ( R# M: M' F' \- n/ P% i7 u! m( L
   tbl = MakeTable(dbg_DB_Data)
* g+ ?( c' n- }2 a   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
) }" p3 o& o- \3 D, l   Response.Write replace(tbl,"|", vbcrlf)
! }8 x5 w1 H' \3 Z& XEnd Sub </P><>'*********************************************************** 3 x9 @7 q  a) ^$ r
'* PrintCollection " D8 s9 n9 N5 Y; N, e
'***********************************************************
+ I* L, S% X& I3 C; m" H9 F, fPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
. y; H% Y9 e( ]* B   Dim vItem, tbl, Temp ! j6 C( y1 c) d3 u+ G( M- q
   For Each vItem In Collection
7 O( C0 m. o, c% p     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ' Q9 _. |0 [$ _4 p" I( f1 |
       tbl = AddRow(tbl, vItem, "{object}")
: {$ l( Q$ R5 ?$ y4 ]! [     elseif isnull(Collection(vItem)) then
4 L# _1 u0 h! J$ ~$ j       tbl = AddRow(tbl, vItem, "{null}")
1 H2 {( i# G2 Z5 D     elseif isarray(Collection(vItem)) then
, u- |4 c0 }, j& y( L       tbl = AddRow(tbl, vItem, "{array}")
  c9 f- U& q) O) b& ?     else
2 X& u& D8 K2 Q7 z) E0 G$ o# C       if dbg_AllVars then $ v  ?: c1 e1 h- r8 H; h
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
( O' B  D; x3 s0 f7 L     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 1 `" m; D4 ?* y0 n0 j- y' Z& f3 @
       if Collection(vItem) &lt;&gt; "" then
+ ^% o4 Q3 m3 t* _4 R6 X$ Z8 x       tbl = AddRow(tbl, vItem, server.HTML" v! W+ @6 D+ J2 p
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") + L- G3 @8 @) X9 \
       else ( Y5 v! e9 t4 N9 @- U: C( J3 l; v
       tbl = AddRow(tbl, vItem, "...")
1 I/ W" l* {) x# ]5 d4 }       end if * j1 N* a& x3 }& u5 q6 t# Q
     end if
" a  x9 `& M$ k$ Z$ m3 r   end if 5 _  K4 E9 {, V: s- S! o3 g
   Next
0 n' ^+ G- @, Z+ S+ ^   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
0 r% ~' t4 l+ v) f+ r4 C9 z! a   tbl = MakeTable(tbl) & r( f4 r: U4 N" v, `
   if Collection.count &lt;= 0 then DivSetNo =2 ! u4 W9 |; v% x7 p( |1 |; y
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ; D/ N0 ?8 I; x% z
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
$ J+ l& F. K+ l) S* ?- U     Response.Write replace(tbl,"|", vbcrlf) / D3 m1 p5 J9 E( d& s' {: |0 i
End Sub 8 K/ m" C2 E1 M4 w* l$ K; Q
  
, N9 c( J; i1 l'*********************************************************** 5 \, b0 D* P- ^: \! s  k$ s
'* AddRow
( `2 w% S, W/ \* L1 R'*********************************************************** , d. c) q% ?& a$ h  _6 Q
Private Function AddRow(byval t, byval var, byval val) , I7 w* D* F5 L/ l6 v! a* B* X
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 3 J9 d- y% A1 _, Z
   AddRow = t
/ ?3 C2 R5 {1 C- MEnd Function </P><>'***********************************************************
6 p8 U; ?/ i' u5 S'* MakeTable
2 J: U3 a6 `" B  p! q* ~'***********************************************************
' }$ L! H: P5 s0 V4 H+ sPrivate Function MakeTable(byval tdata) 9 M! h7 b7 H/ T1 A9 k
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 1 x+ _% q, X) A: P; H1 N
   MakeTable = tdata
& y& P7 i; o3 d: J$ s4 mEnd Function </P><>'*********************************************************** 6 c* B/ p& K3 r" l3 C
''@SDESCRIPTION: Draws the Debug-panel
; f- A3 f2 X- w  N'*********************************************************** , s. x6 y  P9 u5 A8 g
Public Sub draw()
' J, ?3 X5 S- {% m   If dbg_Enabled Then
2 ~' g+ t6 g1 a     dbg_FinishTime = Now()
/ g; j) Y/ q+ h) W# v4 ]  7 y$ P4 A4 ?$ Z5 m# ]" E
   Dim DivSet, x 5 T; \9 T( C6 N, J6 v, K
   DivSet = split(dbg_Show_default,",") % x- m$ l( `3 Z0 B5 w" z
     dbg_Show = split(dbg_Show,",") 3 N$ r' C$ t+ ~. P. t: I# J2 c- R
  + G- q, q( P! Y/ a5 Z* }% Z. n. v
   For x = 0 to ubound(dbg_Show) * n, a( O- t' Z$ ^9 l8 B+ z+ c% q
     divSet(x) = dbg_Show(x) % D2 u5 W4 e) j; o
   Next ( E0 I+ b8 X) ?6 ~5 J4 K
  ; a7 l( n/ p/ D5 N( X* k
   Response.Write "&lt;BR&gt;&lt;Table width=100% cellspacing=0 border=0 style=""font-family:arial;font-size:9pt;font-weight:normal;""&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV style=""background:#005A9E;color:white;padding:4;font-size:12pt;font-weight:bold;""&gt;Debugging-console:&lt;/DIV&gt;"
" {, F2 G. z1 A. d: d+ W& g   Call PrintSummaryInfo(divSet(0))
) t) f4 i  H% {; ^     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
0 i) A% Q/ {: Y6 F6 ^    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") " t% K: k' ~, I6 y& d# N- m
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") 3 l$ G( O& i# u  A/ D
    Call PrintCookiesInfo(divSet(4)) 4 {; \7 U1 Z% j3 r9 ~
    Call PrintCollection("SESSION", Session.Contents(),divSet(5),AddRow(AddRow(AddRow("","Locale ID",Session.LCID &amp; " (&amp;H" &amp; Hex(Session.LCID) &amp; ")"),"Code Page",Session.CodePage),"Session ID",Session.SessionID))
7 b3 P1 t' o% R" c/ N1 Z+ V8 i    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
6 X" T( \6 H0 j* l7 f5 ]    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
6 \  q/ c2 C6 C    Call PrintDatabaseInfo(divSet(8))
! J, S$ {& Y1 C4 B    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") * }7 x1 J1 |6 J1 i
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
% V. Z. M: A& t, j. g4 P    Response.Write "&lt;/Table&gt;"
4 e6 T2 w- ~1 x7 E8 U0 Z   End If
5 G- U7 A! B* `1 A4 a) \End Sub </P><>'Destructor 0 j5 `, g" s7 F5 G# Q% d( f" i
Private Sub Class_Terminate()
8 ]3 n" \# h2 t3 O3 O$ U* H  e   Set dbg_Data = Nothing
. Y, R2 {, k6 {1 x4 A' w+ KEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
8 d! `  X* m* a6 B$ SCLASS debuggingConsole & A) ~# ], ^4 Q7 t
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false : V1 f/ V  ~5 l
&amp;n6 N2 B) i8 O! ?% I
bsp;
4 t9 U/ K7 h. S0 }1 jProperty Get Enabled===[bool] Gets the "enabled" value 7 Q) m0 p* d( |2 ^" w
  8 E- ~( J; a/ E7 I- n( ]% }
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
3 ?$ D  O0 j& @  
1 d8 E- d; s9 d% m$ wProperty Get Show===[string] Gets the debugging panel. + ]9 A7 j8 r  N0 Q, o8 ?( f5 J
  
5 r& G- m) t$ J0 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><>--------------------------------------------------------------------------------
. P& x( Q6 I& s5 h# lPublic Methods </P><>public sub===Print (label, output)
" ^7 q) d4 |2 ]   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) * ^8 ~8 L* X9 h/ `2 u' y
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
( J6 `7 v% a. l2 o+ a  u   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- : u) `/ f5 j1 L$ F) b
Methods Detail
$ r6 n+ ~0 P, M7 s8 I6 m. B4 {  
. E( c5 ~4 ?/ @public sub===Print (label, output)
7 T4 p0 r8 Y0 F  v5 nParameters:  
/ e' `5 q, ]' Z: u2 t   - label [string]: Description of the variable 7 P2 X4 q. U9 T+ P7 V
   - output [variable]: The variable itself # M+ z/ s2 M) @
  . B! g+ @# C# i! E4 V
public sub===GrabDatabaseInfo (byval oSQLDB) & y. u4 ^* Q5 _+ C  T: ^
Parameters:  
, k( j, m" l6 k   - oSQLDB [object]: connection-object</P>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册地址

qq
收缩
  • 电话咨询

  • 04714969085
fastpost

关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

手机版|Archiver| |繁體中文 手机客户端  

蒙公网安备 15010502000194号

Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

GMT+8, 2025-12-8 12:12 , Processed in 0.437921 second(s), 56 queries .

回顶部