QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
  g8 M' ]$ Z' c5 h) D. f6 E' D<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! - J' _6 X' \) _' I7 y1 c& o  B
使用方法很简单:
4 T4 }7 Z/ k0 ^, v- U0 _' V+ \test.asp </P>; Q+ u/ R6 h6 g$ P$ ^
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
" w$ ?0 o9 H5 o# [&lt;% ! Q' s& {) l8 Z% @: G' I, Y
output="XXXX"
- A, z6 D, U5 f& dSet debugstr = New debuggingConsole
- m' u0 d5 {$ o$ K. o8 ldebugstr.Enabled = true 0 Y- e& @  Q7 [( X& w- u( `
   debugstr.Print "参数output的值", output
2 k) J. C: p; A. p4 Q   '……
& Q* m7 w1 a* N8 G5 ]  d   debugstr.draw ! m; t/ b/ ]3 p
Set debugstr = Nothing ; }1 a& l; K7 \! \6 J- Q+ q
%&gt; </P>* j& @% ~" h) \& h% b  L/ Z8 Y
<>=================================================== </P>
0 p7 A+ k- t: C! \2 r, a% Y) s<>debuggingConsole.asp </P>2 v0 H$ k2 c! a; c
<>&lt;%
! k5 X3 S8 l; W, I' UClass debuggingConsole </P>
2 s( C2 j! E& X) d7 q<>   private dbg_Enabled
8 j$ R; I5 z8 Q6 P( p$ i% X* q   private dbg_Show . E* t2 }0 S% D6 ^7 L( @
   private dbg_RequestTime 5 T; k3 A- L! r) k; W1 Z  O( t
   private dbg_FinishTime
) F$ ~0 e/ i" o: r1 W) G! y   private dbg_Data
  Y/ Z( d4 G/ \4 c+ x   private dbg_DB_Data
/ ^3 T8 O7 X- E! m1 Z7 i' S& c   private dbg_AllVars / \+ Y3 J4 P9 f1 g
   private dbg_Show_default
8 R0 w, f, K- c/ o8 J3 G   private DivSets(2) 9 J" {% ~& c; z/ \8 B! X
   6 c  n" v% k+ p8 E& z6 V4 b7 ~; c! j
'Construktor =&gt; set the default values
4 R6 ^+ b8 r# `3 v( Q2 VPrivate Sub Class_Initialize()
$ r& m& U. Q. j" `# |   dbg_RequestTime = Now()
4 O1 n1 [, a# i* z   dbg_AllVars = false 2 F8 S9 a- B. e/ d* u1 V
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
% F# i, ?! T' }9 V* m<>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>; s$ |& m/ g) q9 E
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
4 |: r$ X% K6 Y&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>
9 \+ N+ m! L! \" I2 O% H1 G* I5 L<>   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>! e) A- y  K6 l- ]( F) o! f
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
% S8 k/ y5 E: Y6 ~8 ~0 C! lEnd Sub </P>4 l5 t  M, m8 L2 J; S$ C
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false " `) n& V  O5 |, O% v& L
   dbg_Enabled = bNewValue % K/ n0 Y$ W; {5 p: f+ }
End Property </P>& h8 v/ C; v0 k$ V3 y/ f
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
5 C8 j8 H2 j: E   Enabled = dbg_Enabled 5 r/ P$ v8 Z/ L) }$ ?: U/ ]7 Z4 e9 l
End Property </P>
, `/ Q) L. I" R6 r& C& |- H6 K, N, J) \<>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 % R+ N7 T/ R( N6 j
   dbg_Show = bNewValue # W8 {* \7 E' K0 T" X
End Property </P>
1 @0 L4 j2 R/ G! T<>ublic Property Get Show ''[string] Gets the debugging panel.
9 H8 t( v' ]1 u! h   Show = dbg_Show $ H$ R2 P* o5 n
End Property </P>! n4 w- j) r5 r( |9 X
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
& B' Z3 i& f" A4 c+ }, L   dbg_AllVars = bNewValue ) j+ `2 A0 G; C% p8 Y
End Property </P>
# R/ L) M& @  [: t# F& k<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 2 A; E4 Q2 G% t6 g. P; i" m1 l: }
   AllVars = dbg_AllVars 3 s3 m# p5 _3 A! ]+ D- X' \6 @( @
End Property </P>
. P1 k: V+ _$ d$ M+ y<>'*********************************************************** 2 k" s9 ~2 [. V' @% t" P1 X
''@SDESCRIPTION: Adds a variable to the debug-informations.
0 ^0 c, v" f9 X! d7 J3 g- p8 h% W''@PARAM:  - label [string]: Description of the variable 3 ^1 k- U; ]' s, m+ F- A" L3 [
''@PARAM:  - output [variable]: The variable itself
& W5 A; H" C$ T1 n8 W. z'***********************************************************   e" `6 E" e2 o0 q1 g
Public Sub Print(label, output) 4 ^( q  }. R9 s4 t% o5 }" L
   If dbg_Enabled Then
3 D2 V  y( G; e* `     if err.number &gt; 0 then
! q" B& v  D/ |) ]+ w       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
# n+ W" p- i8 ^" r       err.Clear
& m) j* n2 L: h5 Z3 M% Z     else * p+ X1 K5 R6 D5 Q4 ^8 |! g
       uniqueID = ValidLabel(label) ' u: U3 _( g2 A2 q, F" l
       response.write uniqueID
3 Z1 B' t# t3 f" p       call dbg_Data.Add(uniqueID, output)
; z$ e+ ^, ]4 \0 A5 u; T     end if
4 Z% M: n8 i- t   End If # b+ F2 ^' p2 H- `
End Sub
$ E0 E1 Y* G, e) N. s" C  
& H8 R7 Y$ T  \4 s'***********************************************************
' m8 M$ a: i( i# e$ o+ A'* ValidLabel
: U( \; T3 e" X'*********************************************************** " S: O+ _" D( A  t. q3 B
Private Function ValidLabel(byval label) ! N+ G* _9 E. Q$ j1 X
   dim i, lbl ( c0 ?+ G/ y( ]* b* n/ e
   i = 0 . d! `) z' F+ F
   lbl = label 1 W( u# T* A3 F# G
   do
9 W/ w  W8 u, ?4 ^   if not dbg_Data.Exists(lbl) then exit do % A2 q( t% G+ i4 _# O1 q; Z% Z
   i = i + 1
5 F& S3 d. ?# ~& n9 L   lbl = label &amp; "(" &amp; i &amp; ")"
. y6 o) t. u6 }$ A8 E( n8 |  t! d   loop until i = i
- j  W& K5 h7 q. ~! H" {  2 n  r4 h) G' A
   ValidLabel = lbl / ]0 F8 H0 \/ \2 d5 ^+ }2 S( \
End Function
5 D5 h/ W! u1 m. m' D  
$ q/ k* ?5 l# A2 Q8 g( M'***********************************************************
& O# Y; |8 r  b& ]7 ?'* PrintCookiesInfo   G# I9 C0 N( K: v! Z/ t3 e
'***********************************************************   `0 p- q" O4 h' ~- C8 ~% g! d9 q
Private Sub PrintCookiesInfo(byval DivSetNo)
# M: L8 n2 H7 N' C   dim tbl, cookie, key, tmp , v1 \- v) T& A$ o/ Z# K
   For Each cookie in Request.Cookies + y& V# g# D. {8 O$ z$ f! _
   If Not Request.Cookies(cookie).HasKeys Then
, Y6 x0 a1 a+ b* t0 e/ L     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
. m9 Y# _4 m, a" v3 x: O   Else 0 v1 w! Z1 {9 k& {% c3 l9 W; n
     For Each key in Request.Cookies(cookie)
; P$ O+ N" P/ Y% b6 T     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.   ^1 ~1 a! j5 e5 l' ^& }/ N
Cookies(cookie)(key))   " ^: j  g3 a  [- q( D) I9 ^7 {' ^
   Next
1 A" x7 {' a6 u. W" Q1 S) K% Z( J   End If 1 y* C, l- ]# E; D  `
   Next </P>8 l7 M- m: Z6 a* Q1 a* p
<>   tbl = MakeTable(tbl) 1 ]: c: z+ m/ M9 ?2 F) Z6 j- B: E
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 5 E, G' F. Q' Q. E
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 8 j0 b; _! t% l9 n' [* F
   Response.Write replace(tmp,"|", vbcrlf)
5 I2 x0 h" r+ J" P8 r' d$ Wend sub 8 _+ G% A8 c' h4 t
  
- L3 x# i% h$ {* U( n3 r; Q" v+ o9 W'***********************************************************
2 R, Q. z' ~: W+ G/ L4 @8 d'* PrintSummaryInfo 0 V: _0 y* E1 I" U
'*********************************************************** " @( H" J* R8 S) j( G' W; w
Private Sub PrintSummaryInfo(byval DivSetNo)
: S) ^9 h1 g4 {! h7 r; B   dim tmp, tbl
; y  P6 ]& m0 @) b   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 3 ]! c% f; P  b
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
% [# f* m, e/ I, g$ J   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
2 L. V. J8 U0 s  s( V; f   tbl = AddRow(tbl, "Status Code",Response.Status) ; m* e- I+ |# H4 n/ |
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) ) l2 c# |- l" z0 m! _  J
   tbl = MakeTable(tbl) 7 K2 w! i( s" P' Q! N
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) * c' I9 B3 R4 |7 M/ E# T+ ~3 T% W
   Response.Write replace(tmp,"|", vbcrlf) 1 E3 Z( {6 q( }* Q
End Sub </P>
4 f. R. m  N3 W<>'***********************************************************
9 y. e5 g! E: q1 w& b''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 6 r: }1 N- p7 l+ w( d
''@PARAM:  - oSQLDB [object]: connection-object
" R+ {9 e3 I) ^1 p* e  J1 t'*********************************************************** . M* K& A7 k& y0 i  Q7 s# e# ^# z  B
Public Sub GrabDatabaseInfo(byval oSQLDB) # L$ U1 _9 q# R. r# ^
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
- y) S0 d/ D4 l, z   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ; @% r. ~1 |# v8 }, G& ?) x5 J
   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"))
! P. R3 [2 ~- B8 F   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
& C/ e+ b  T, F, H- {8 SEnd Sub <>'*********************************************************** " K0 @9 d: u6 l0 V$ k( k$ V6 p& M
'* PrintDatabaseInfo
' I- [$ a+ @4 b- n0 J  B2 C5 g'***********************************************************
! W* c9 |0 o! j8 ePrivate Sub PrintDatabaseInfo(byval DivSetNo)
! _* q9 ?; [4 I   dim tbl 4 d4 U, ?8 D/ |( A  y3 c% l3 u: x
   tbl = MakeTable(dbg_DB_Data) % t! w& @/ X& k5 }
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ; `9 e0 x! t$ Y
   Response.Write replace(tbl,"|", vbcrlf) 5 k) N5 ~' P( M$ S8 U. w. r0 l
End Sub </P><>'*********************************************************** % k4 i: T* J+ |' A* R3 C$ Q9 X5 v
'* PrintCollection
2 g# f: q, e9 o2 B'***********************************************************
5 C' t- Z% P; d) pPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 2 c: b" |& j' W7 F7 K9 M% `4 g
   Dim vItem, tbl, Temp
2 |  x. m, o0 y   For Each vItem In Collection
9 B- v5 \2 q1 z  z' D     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ( @  l5 L) x, P
       tbl = AddRow(tbl, vItem, "{object}")
3 j; {4 i& Q5 K- A6 n     elseif isnull(Collection(vItem)) then ! N$ ~8 a- h5 Q% {& E& Q9 ~
       tbl = AddRow(tbl, vItem, "{null}")
1 A9 s' A! H* F7 ~" N1 z3 O/ N     elseif isarray(Collection(vItem)) then
& h* J5 W1 @( r5 B' w+ J# c       tbl = AddRow(tbl, vItem, "{array}")
. ]2 c4 A$ d* [* \; u     else
6 Y: I$ m# [& ^       if dbg_AllVars then + q- x$ d6 V1 X; Y1 L  ?% Z8 U
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 8 M+ K& ]- P+ Q* k9 g
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 4 M: S2 r/ o( q  v( D. y$ p
       if Collection(vItem) &lt;&gt; "" then
$ B5 e! P8 Y5 j, s; y5 _5 B       tbl = AddRow(tbl, vItem, server.HTML  f9 }* y6 A" V0 ~9 \" L
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
% S7 X& z; o2 L+ L2 h- C8 z1 i       else
7 `6 F( C) J+ M- x; h" M6 G       tbl = AddRow(tbl, vItem, "...")
( U$ u+ w: `5 z5 b  u' d1 e       end if
, v, F3 w, y5 ?     end if " }3 d# k: E6 R# |7 b
   end if
& g0 x# ]; L; ^, E$ A5 Z" \   Next
% H' u5 o# r" L3 s( p4 O: d   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo $ Q: N6 T7 l2 {! y# |1 Z: X2 T3 s
   tbl = MakeTable(tbl) 3 z8 y0 v* F+ D. o% C4 p
   if Collection.count &lt;= 0 then DivSetNo =2 3 Q" E  F0 z& C# A7 ?
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) & @' a1 X* ]6 ?# |9 I- V
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) * K. L2 w- ?! A* [
     Response.Write replace(tbl,"|", vbcrlf) 9 n+ X5 `' @4 `* @2 Y
End Sub ! N. o& t; E3 [5 B" O; }$ W% S
    b9 V0 Y4 u; u+ b
'***********************************************************
% [! Q+ n  W# w% O2 O6 m'* AddRow
2 x" o6 d+ r  U4 ~. \9 h3 q'*********************************************************** 8 Z& [) n- L+ g  Y; b6 k9 I
Private Function AddRow(byval t, byval var, byval val)
! g# {& }0 @  U0 E5 J1 {: J" f   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
0 B/ C; b+ H1 e: y, ?   AddRow = t 0 H0 a2 J9 T( K+ |
End Function </P><>'*********************************************************** " S) }% p8 L( g& |0 J) E" B7 \
'* MakeTable
# a% E* D, T9 M. b% t  w7 M+ H' y9 H'*********************************************************** " l' }; D5 q4 E- e- k  X$ c
Private Function MakeTable(byval tdata) . Y1 O2 i8 b4 W, @3 ~# V
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 4 H0 Y$ ?' E, r8 S
   MakeTable = tdata 4 p/ q" u/ z- l- L4 C" E  X
End Function </P><>'***********************************************************
  X* s  W1 v6 E5 I''@SDESCRIPTION: Draws the Debug-panel , b' |. b' N/ f2 x
'***********************************************************
% A0 R% Q& v0 zPublic Sub draw() 6 H' {0 J) g; F
   If dbg_Enabled Then
2 ]5 d( @, t5 E     dbg_FinishTime = Now()
& O. Z+ J; A8 w  0 O  C& r9 v0 }( c1 h
   Dim DivSet, x
) K( e% @% c$ O: h3 X$ Z+ n' v6 B   DivSet = split(dbg_Show_default,",") 5 v7 }  m! C, \& K2 U2 s5 W
     dbg_Show = split(dbg_Show,",") ) k$ T. Z8 w& [8 R% n( _
  
( Y( v) i2 n/ F. r1 W! R   For x = 0 to ubound(dbg_Show) ) Q  H+ C; u3 I2 j0 g5 R
     divSet(x) = dbg_Show(x)
* t4 h% ~0 R& c3 P  |   Next
5 D  w1 c8 ^+ X0 I( i; k  
5 Z* e6 F4 ~) S) l. m+ f0 h! B   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;" $ V8 F+ {2 ]" Q8 Y. a9 B( Y% q
   Call PrintSummaryInfo(divSet(0))
; B$ N- P( j+ o6 `     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ( ~0 m6 i  S& P: F. `- m) `
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
, y9 T5 ]7 B/ P! ?5 B    Call PrintCollection("FORM", Request.Form(),divSet(3),"") 3 z/ t$ W2 y/ a( c9 ]: ]0 Q
    Call PrintCookiesInfo(divSet(4))
$ Q0 d+ ?. B. ?$ O: ~5 ]  G  K/ V' ~    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 T. O5 G6 F/ L- ?3 u    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
( e1 t0 d% D2 Q' n5 J    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
3 c) n8 D# U( v    Call PrintDatabaseInfo(divSet(8))
9 R- x4 \7 c4 [: q4 S    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
' o* R* z1 @2 K" q* c6 z4 s    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") / j! i. q( v8 l0 i0 ~
    Response.Write "&lt;/Table&gt;"
# K1 f* g& u$ I! F4 G" i1 r' U   End If
) W4 @& z3 D' z* vEnd Sub </P><>'Destructor
: x! N0 _8 r9 g8 V! p. hPrivate Sub Class_Terminate() : g3 Y- p4 G: X( G
   Set dbg_Data = Nothing
+ r! g$ ^- G  a: v$ h) y: lEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>2 ]+ Y6 d0 s1 l4 I0 M
CLASS debuggingConsole + R% k& Z2 s7 Q! n
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false # t+ Z* q9 G, X. G
&amp;n
* x5 _0 K6 b. S6 pbsp; 4 j' S6 U, j+ q4 f4 J
Property Get Enabled===[bool] Gets the "enabled" value ' b% Y6 ~$ u* u/ _2 Q3 v# c& h! P
  
3 E) D8 O$ n/ |/ b: b4 @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 ' @: U; c& g$ K3 j
  
8 ~' r. d8 r3 C( D3 GProperty Get Show===[string] Gets the debugging panel.
5 F( t8 f: |( i9 ^- {8 l  # _& d) G0 W, j0 n5 ]% d
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><>-------------------------------------------------------------------------------- 4 y( y1 b0 ], H4 g3 E# u0 x. d
Public Methods </P><>public sub===Print (label, output) ) e# u4 a4 u- e4 ?  ^
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) & A, s/ ^0 B' o& j8 H. {+ |; c; [
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
) w' r  w* `/ {5 R   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
0 P3 D  W# d% Y& M* r: k9 o4 d5 ~- YMethods Detail % J* O. L' G$ K0 C
  
. R- i7 e2 a4 d% g- I) o$ ?( d/ {2 {9 vpublic sub===Print (label, output) % b: z6 @# v6 p
Parameters:  
% x8 \8 h  V- W( `# T   - label [string]: Description of the variable
8 x/ h6 v0 `3 P% j3 \   - output [variable]: The variable itself / w* t! E, z+ f2 V3 e2 T
  / i# r1 c1 O# S$ f: v8 X
public sub===GrabDatabaseInfo (byval oSQLDB) 7 G' @4 Z1 D0 T% K1 \" f: g
Parameters:  ( B) J; A! J# |7 S3 [6 z" b
   - 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, 2026-1-14 22:41 , Processed in 0.455194 second(s), 56 queries .

回顶部