QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |正序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>7 H, L7 h4 {) v' q7 S
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
, T0 T8 h# H- D7 b8 b. \使用方法很简单:
; A8 I- S" `+ k# s4 \test.asp </P>) ]) l8 ?/ K7 K- T, V; p
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; " [+ C( Q: _0 @/ X' e7 k
&lt;%
, \; u2 I2 ?( U: X9 Soutput="XXXX" * S. n* }/ |+ |8 z, O
Set debugstr = New debuggingConsole 3 D# k8 j2 V! [- n
debugstr.Enabled = true
3 P1 ?# e' c3 A  V   debugstr.Print "参数output的值", output + B$ [1 @' T  n! q+ X1 z* c
   '…… 2 d/ ~2 \* Z% E* G# q$ D
   debugstr.draw 9 j. E  Y2 M6 U+ }7 q
Set debugstr = Nothing $ ?8 l, j! u# S0 b9 r- d- ?6 ~
%&gt; </P>
" j2 f2 R* v# v) f4 o$ r<>=================================================== </P>6 z: [/ {3 x/ y/ m1 b) H
<>debuggingConsole.asp </P>
" P) r1 U6 Q$ s% ^+ A% Y7 u<>&lt;% ( E$ x% J! i$ O9 R. \
Class debuggingConsole </P>" P9 e+ v: f" b* P9 {
<>   private dbg_Enabled
* ~8 x% D& ], X# h! Y8 I, ]! |   private dbg_Show
) ^& z; v; T: H. n* b   private dbg_RequestTime
/ o1 T2 o6 u2 n1 ~" }4 _4 x& c, D   private dbg_FinishTime
$ g" A  p! `% n   private dbg_Data 2 F; {4 {* T+ s& K1 ?4 D
   private dbg_DB_Data / ?/ M) ~" Y8 e1 t7 W$ }
   private dbg_AllVars 5 V3 u8 t5 Q  m7 t$ B" ?) U
   private dbg_Show_default $ m9 x4 k+ F5 Y( m* q& x+ D: q. h" T
   private DivSets(2) 2 `* s" x" c$ }# C$ ~. ?' `  C
   
" `8 u- Q0 u6 x" d, ^'Construktor =&gt; set the default values 1 {9 D' y$ F! \; G' v* Q
Private Sub Class_Initialize()
3 ]" |; R* w2 P5 W: |   dbg_RequestTime = Now()
$ ^" E/ P7 e% Z4 l4 N   dbg_AllVars = false % g+ H" H) b4 K) t
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
5 f& D7 Z% j6 [& {6 h3 b! T<>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>
( t6 u- n; ~# q" ~<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;6 V, Q* _/ o" V6 Z. B! o2 d+ B' l6 T9 _
&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# F1 r; y/ ~7 \& G$ O
<>   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>/ G9 Q9 a3 Q' g5 Q: y- u' t/ g: g
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" : |: H& N+ \6 s  K8 o9 M; r
End Sub </P>. q* R: R/ p1 l, X$ |' o
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
# U% }# A- m* u! H+ I   dbg_Enabled = bNewValue
3 ^9 o$ M  |: Y2 D+ REnd Property </P>
  F  R! B: J5 ?/ X: y- |( Z2 o6 P- X<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
3 y. u0 G3 Z8 M$ P   Enabled = dbg_Enabled ' i2 @; i$ m& m! Z  o
End Property </P>, X! H" M9 }, c% K
<>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 + g7 D0 G3 l- P' B# |8 g- ^
   dbg_Show = bNewValue 4 |, ~3 F- h( P7 s5 l8 H; T( o- o- m
End Property </P>
/ ]  I* ~9 A, K; O- I<>ublic Property Get Show ''[string] Gets the debugging panel.
* T4 d" b( {; i   Show = dbg_Show
6 t( f, M5 @! o6 U+ R; Q' lEnd Property </P>6 f0 }8 _: T3 e, f3 P8 p
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false & F7 n  I; H: h/ f( m0 e; q
   dbg_AllVars = bNewValue ( n0 f- |' U0 t" h1 I8 k; Z
End Property </P>
: o0 i+ a5 O! T1 ]3 V% d  p<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
4 ~7 A8 Q, }1 E9 F! ?- C- g1 ?   AllVars = dbg_AllVars
9 ~; I. e) q$ Z4 h* r8 }8 @End Property </P>6 h; a- J: ]3 _" _) \$ @) [+ ~: L
<>'***********************************************************
& ~. Y! X, B4 D& }3 s& R' K''@SDESCRIPTION: Adds a variable to the debug-informations.
$ {9 i, ~3 m6 F1 ]''@PARAM:  - label [string]: Description of the variable
  l4 k2 E5 S' M% R''@PARAM:  - output [variable]: The variable itself - t; q" v. L2 x3 |- ?2 s
'*********************************************************** 8 ?8 h/ ?3 K; J9 ~6 o' m/ t
Public Sub Print(label, output)
- q* T9 H. s2 B, ?+ a   If dbg_Enabled Then 4 Q* A# I3 X; X% a! U+ o( b( O+ G
     if err.number &gt; 0 then
0 R0 W4 m0 c% r; ?       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 5 s. U) C+ M' u" g" |8 V5 H7 H( B+ p8 d
       err.Clear % ]! t  O' H) N' q0 y8 E
     else ! d' U# ~, W& s3 t6 T' z
       uniqueID = ValidLabel(label) ! C: S. H& I0 N. _* A9 n" f
       response.write uniqueID & A6 r* f( T! {' ]" c" J- M- V& x
       call dbg_Data.Add(uniqueID, output) 9 c5 D2 g: z( H  d9 {
     end if
8 v! W# J$ y6 Q+ x; l6 D& v; J   End If
- k! o; N; W% o; p0 G6 SEnd Sub
# t5 ]+ ]8 A( `) u) O" R- M  
0 p# s+ L6 T$ S! J0 G! P'***********************************************************
. y: C& s2 w2 `9 k* o! }  n- n'* ValidLabel
7 C4 h. a* [" g% q$ M. x5 ^; O'***********************************************************
  ?3 R1 m+ z2 X7 K! nPrivate Function ValidLabel(byval label)
1 r$ B/ n" z4 B: c, V( D   dim i, lbl # {8 M/ L7 P7 @& g
   i = 0 3 w  D  i# ^" }& A. h/ R0 N" t5 x
   lbl = label $ B5 w- E7 G, b
   do 6 C2 [$ O+ [5 C% K: ?
   if not dbg_Data.Exists(lbl) then exit do 8 k. J' W$ N! P
   i = i + 1 5 ^& _) _% q' J- \* j1 _# V( g, B
   lbl = label &amp; "(" &amp; i &amp; ")"
/ a% v3 B' f4 K9 T! B# c   loop until i = i
  `6 c" ?3 _3 V& Q. O5 {! u! `  ) }. F1 D* T, [& e" X  J# a8 [
   ValidLabel = lbl 6 t# H" H+ D2 p& n9 P% L
End Function ( [/ |9 C" w  X- Z' O5 h. @
  
7 f/ e$ T7 f) l; ~, L'***********************************************************
- W: L, \! N" E9 N* {'* PrintCookiesInfo
& N6 j7 l4 T* i'*********************************************************** 3 X4 _, r7 f6 J( _' b
Private Sub PrintCookiesInfo(byval DivSetNo) : Z% ^; K, n+ O
   dim tbl, cookie, key, tmp 7 s1 q4 T2 i* O
   For Each cookie in Request.Cookies
8 v9 I1 }! q' d  j   If Not Request.Cookies(cookie).HasKeys Then
: s! w% q) X) S3 M     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
( L. u/ }, f, H   Else # j7 S* D3 _' G9 |0 V5 a
     For Each key in Request.Cookies(cookie)
& T( y2 X9 u- |  `9 i" {* X     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
3 i3 W8 |0 ^' WCookies(cookie)(key))   
* V& y* I6 _) n& D8 P2 y* l4 x   Next 3 ~* w6 `( E, i
   End If
! L$ z& g  z5 _+ k& T" |   Next </P>& _& e4 D8 i8 b+ _9 k; T# i
<>   tbl = MakeTable(tbl)
$ n7 l: Z+ n, J  [7 u   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 ) t- ~2 l% U9 C$ l' \
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 4 w( ?. f4 y- M$ l$ _
   Response.Write replace(tmp,"|", vbcrlf) + o: ^2 Z1 @0 `1 ?1 P( d+ ?0 B
end sub ) o  ?( g1 Z1 ]% @" w! Y/ u4 W% Y2 a
  
  k' \- [1 q; t'***********************************************************
, ~% ^0 f3 x- H2 y2 @: z6 w: J'* PrintSummaryInfo
$ G) g' }( Y* d7 u0 H% ^9 B'*********************************************************** 0 ?% H9 q3 K2 G& i% L2 `3 {
Private Sub PrintSummaryInfo(byval DivSetNo) . y* W- A" |6 M0 C- t
   dim tmp, tbl / L8 b0 s, }: N6 ^3 R: C; e: ?
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
, `0 X& c8 V6 t+ _8 o% ]) f   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
2 J6 C1 r* N  s9 k9 p   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
) s4 z- ~; S' \( f   tbl = AddRow(tbl, "Status Code",Response.Status)
5 j- Q" r6 l6 k+ L( D0 I& |   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
* O1 V6 o3 j5 [# M+ v& b   tbl = MakeTable(tbl) 0 J7 g9 b* m' H9 K& X  {( P3 Q+ P
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)   ^# R- D8 U: O! a* x. W- R2 E
   Response.Write replace(tmp,"|", vbcrlf) 4 W  Y& O" e- |2 E
End Sub </P>
* ^: d: e; i1 p. O$ F9 ?<>'***********************************************************
4 x8 n, ~( x& K- C''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
' q8 ~+ j$ G- Q2 J5 C2 l''@PARAM:  - oSQLDB [object]: connection-object
$ ~; u8 Y$ \# n'***********************************************************
6 D* k+ D9 S8 _$ ~! ?) k/ a5 O* y. bPublic Sub GrabDatabaseInfo(byval oSQLDB)
1 I$ R5 D  N! c" G   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) - D5 E4 S0 o& A/ \( d' d; ^% {$ e
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
* q: E+ M- T0 N" L- B6 k& r   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"))
' y, f& J" H" H1 |  i/ D, E   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
' v) M; \- {) q9 s) UEnd Sub <>'*********************************************************** 0 [% {* ^1 l5 h; d
'* PrintDatabaseInfo + q. u" U' u# o' C# c# ]
'*********************************************************** 0 \5 ^3 z$ f- v; I
Private Sub PrintDatabaseInfo(byval DivSetNo)
2 a' u# W. J0 v, i0 C0 F6 ^& G: q$ O0 ?   dim tbl 7 o3 X  i: j# f, B2 P9 F* i
   tbl = MakeTable(dbg_DB_Data) ) ]. p% G  k* L* @8 s( J7 }' {
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
9 [' M! ^; R+ y" C   Response.Write replace(tbl,"|", vbcrlf)
3 s  Q+ }% v, EEnd Sub </P><>'***********************************************************
+ D3 }) w' v9 W" Y! b& k" Z'* PrintCollection
8 t! N/ X1 z) u'***********************************************************
. B+ l% f$ T4 s: L- S9 DPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
5 s( W. u. C$ v& R0 i   Dim vItem, tbl, Temp : f. H4 o+ c$ ~2 r
   For Each vItem In Collection
6 f! a4 \. D; P. q* l6 \9 x6 A     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
( V& x) z1 U+ V$ I7 |$ A       tbl = AddRow(tbl, vItem, "{object}") - m+ z' c7 f7 _; |2 C
     elseif isnull(Collection(vItem)) then
( g1 z7 ^6 a; {, m3 m7 }7 R/ s1 T       tbl = AddRow(tbl, vItem, "{null}")
. h+ @$ r. M" O# R4 E+ t     elseif isarray(Collection(vItem)) then : P1 d: D8 t- i- Q; ?8 q: I8 M. C
       tbl = AddRow(tbl, vItem, "{array}") - D% y, D2 [8 \8 D6 v
     else 0 h1 f. @6 P& o* ]
       if dbg_AllVars then . Y, o0 o, m# }) ?+ ^2 z6 R
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) : m9 d- t; R4 D) A2 Y- R
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
% m  J& t! a6 P! }3 s9 U       if Collection(vItem) &lt;&gt; "" then " O* Q$ }7 D4 f+ c
       tbl = AddRow(tbl, vItem, server.HTML
! m2 o$ F" @/ p! |; FEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") * g0 A% O+ j8 }0 Q' t; I. f
       else ( j& l) k5 }' J! Q! v
       tbl = AddRow(tbl, vItem, "...") 2 A7 _/ e6 X! t1 K
       end if
6 k4 F, F; M% m& ^7 C; Z     end if
; L/ Z7 |$ r# ?$ H/ L: S- r. V   end if
; i5 [( b" [3 R# c; a2 K   Next   j! F: w* ~2 O: e# [
   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 o# k0 k  l/ w9 n" }: v
   tbl = MakeTable(tbl) * z! h; l$ q2 W- l. N
   if Collection.count &lt;= 0 then DivSetNo =2 ! g3 T2 ~9 V& O! M. l. Y1 m+ Z' U
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) + Z% Y/ ^5 u/ w, k7 g/ G
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) $ n$ ~- t$ t4 Y+ R% W
     Response.Write replace(tbl,"|", vbcrlf) 0 |2 g& z+ ?* K, d: c: C8 w# A
End Sub ! E6 R. k+ y# ~' L" n
  9 }0 b6 i$ D( b
'*********************************************************** ( R$ r6 D2 Q9 y
'* AddRow
; A& ?- h* r, v'*********************************************************** 1 h) h2 \* K- Z6 B$ V
Private Function AddRow(byval t, byval var, byval val) % s! {3 v* k; @
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 5 a$ Q9 j6 t  d9 ~, q6 N
   AddRow = t
- M8 t; a" A  MEnd Function </P><>'***********************************************************
+ d. z2 z2 h+ s$ W$ y/ E5 Y* u'* MakeTable
; k) V! F# J, |+ q7 H'***********************************************************
5 u1 g/ X& K/ _0 `" IPrivate Function MakeTable(byval tdata)
2 f" ^- P* t( |7 z/ K7 N7 A% O2 z   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" : J4 o! c0 _% C1 P
   MakeTable = tdata 5 ~# `1 }; t/ A$ @% j) r4 F  x
End Function </P><>'*********************************************************** # N5 H2 i3 d$ I6 C$ ~' l
''@SDESCRIPTION: Draws the Debug-panel
. L, m1 D/ m7 u# t; g5 h'***********************************************************
7 l4 b$ {$ r6 g6 N7 e# }0 X$ RPublic Sub draw() ( f& y, ?* R1 Z4 S
   If dbg_Enabled Then + l$ D7 h, l; V; |* K# S
     dbg_FinishTime = Now()
4 f2 n6 x- |& ~; Q  o6 Q# Y  
3 W) B( ]* ^; U6 \- A* H8 A   Dim DivSet, x   b. Z  c& }  A7 F* X% P( v, q+ U
   DivSet = split(dbg_Show_default,",")
& r2 H% P0 s: e     dbg_Show = split(dbg_Show,",") * U% C4 r! O6 P: ?* @+ H  t
  
1 A# P5 ?' r( p) ^: J4 [   For x = 0 to ubound(dbg_Show) - F& e+ E- ^6 ]" \, T" T! [; k
     divSet(x) = dbg_Show(x)
. A1 ]$ s% p: n) x4 _. u# e   Next
; m( g! \; B: y( w( J1 J  $ Y3 `* M/ d3 L6 @  w' U
   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;"
3 u6 x) y! b. `' ?+ N: V2 ?; M   Call PrintSummaryInfo(divSet(0))
2 o1 o9 N1 E& j0 l$ R* d2 T: y     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 1 q, |. ^6 q- R* |4 Q
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
0 Z0 v4 {- L( V( ?$ C1 @( j# o    Call PrintCollection("FORM", Request.Form(),divSet(3),"") : |$ S% m! A- G( N
    Call PrintCookiesInfo(divSet(4))
# x. f% D1 z) h( i    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))
  P, x+ ^! W, J5 r    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 1 U% E& v4 X- }+ P' F% F
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ( ]# ~: t2 K4 B" m$ T0 {
    Call PrintDatabaseInfo(divSet(8)) 4 o3 p) T2 T6 O; g
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") $ P6 F+ `& U# N5 d& g
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
1 d- [1 _8 W- e, @7 v( [3 |* E! C. O! h    Response.Write "&lt;/Table&gt;"
* r) j: |/ \4 L' o7 r' D   End If
4 M/ g/ h( k, Y! p/ `End Sub </P><>'Destructor
5 Z, Q8 Q$ L4 b- \3 l- LPrivate Sub Class_Terminate() * b8 C' r% V, t. z
   Set dbg_Data = Nothing 5 Z7 X4 x/ g$ S8 ~( d) R
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>9 P1 w+ b( a# u2 K5 t
CLASS debuggingConsole
6 E& q9 a2 O9 ?3 I% R8 d# GVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false   n; F0 ?+ p  n5 E. q1 }
&amp;n
+ [- {8 @  V& W% O$ T: S  D+ cbsp;
$ _; K3 G& [- a2 b9 YProperty Get Enabled===[bool] Gets the "enabled" value & D3 g0 x! w7 f/ {+ i
  4 ~7 |8 X# I- U+ i" Y
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
8 \) A0 r4 i# s) ~4 }9 L$ z  . e; q# Q" u: }% {" o& L
Property Get Show===[string] Gets the debugging panel.
4 a$ }0 Y; c6 `( T: s8 ^  
- P/ b+ w# q& W2 l2 a5 ~7 ^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><>-------------------------------------------------------------------------------- # U9 s8 e! D1 s/ ^$ G$ G
Public Methods </P><>public sub===Print (label, output)
7 ^' y- m! R! {0 A   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
, ^  z5 a. K* e   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () ( D9 B3 @! M5 y9 o# s0 [
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- / u% l' I* g- o$ M3 K: Y
Methods Detail
; f4 y/ |; v3 L. B" c! b( v* N0 L  
6 A1 |/ s  x2 j# O/ H, T' e! y' D! qpublic sub===Print (label, output)
- n" e& j) r+ v5 z0 AParameters:  
" x! Y* F* I- K   - label [string]: Description of the variable
' f2 }1 e" I! r( S- d! R3 J   - output [variable]: The variable itself
) L- z" G( W# I( s2 F1 b6 J  - P# k$ |0 Z. D3 Y$ B) Q
public sub===GrabDatabaseInfo (byval oSQLDB) / ^$ O: O5 W6 w1 i, B1 J* v$ r
Parameters:  
, O# e3 g, t( O+ q' |   - 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-4-16 02:26 , Processed in 0.716510 second(s), 58 queries .

回顶部