QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>0 S/ [5 [( B$ X- G/ u
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 8 U" `% }. u' ^6 ^4 e9 J3 z, ^
使用方法很简单:
+ z8 l) T: o" y( V7 Z7 ?8 dtest.asp </P># E" M# |* w/ N0 Q* f6 y
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
+ |/ `1 G$ q" ^; M/ b&lt;%
! ~( i2 p7 ~; Z& \: b; b4 Houtput="XXXX"
5 R- C7 n, O# Y& Z0 h* d6 RSet debugstr = New debuggingConsole
( U0 l7 r7 u' A2 Bdebugstr.Enabled = true
) t2 Y! j5 o9 p! r   debugstr.Print "参数output的值", output
' A+ a) I5 p  N- Q( h   '…… 4 F4 a& I' @; z3 b
   debugstr.draw # l/ q( `$ y9 J
Set debugstr = Nothing " g' x/ G' J" h# i6 [, H
%&gt; </P>) D3 c8 x' F7 R9 k
<>=================================================== </P>- G" y  u5 m. e) {$ b4 G* H
<>debuggingConsole.asp </P>
4 z) e! e  C/ P$ M1 k- o<>&lt;%
! l3 g( R& J$ l1 A  ~Class debuggingConsole </P>2 o; L6 A; b' y  L" x6 h
<>   private dbg_Enabled
, k& `  N" B' {- |8 ?: T   private dbg_Show
* f0 H6 F$ D# P( E5 v; @; J   private dbg_RequestTime 6 e* ]$ Y9 A5 K
   private dbg_FinishTime
1 e/ \6 y  B! g$ G5 u+ O   private dbg_Data
+ `* J  B* k" N* B# z5 U- b" ?   private dbg_DB_Data
! f% s7 t5 |+ x: z2 u  K5 r: _   private dbg_AllVars * \- l# N/ P( X9 }  F: A
   private dbg_Show_default % w, R7 G% j4 f
   private DivSets(2) 5 \8 \) o/ ]5 E  ~9 U# L
   
5 c. t' N0 F& z'Construktor =&gt; set the default values
9 K/ \% g  c) f5 x5 u4 lPrivate Sub Class_Initialize() & }! p3 i1 m0 y: _, P. x$ h
   dbg_RequestTime = Now() . y1 p- M! E( l4 g; o
   dbg_AllVars = false # X7 u9 N; J: E- o2 _( b: x* a
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
8 G2 x( w. {+ E5 |<>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>
5 I2 F$ C2 @. n# O<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;0 m( R  ?( t5 A. B; f( n
&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>
  i2 P- Y* Q$ ]! n, T+ d<>   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>
8 s  I  b& p1 h" j<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" 8 p# M- }  Z! w
End Sub </P>* h3 R) D7 N' l& u
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
. R% P& A$ o3 n2 f% w. y' K! b   dbg_Enabled = bNewValue
( E6 A  I% x7 OEnd Property </P>
  _! ?, Q+ R$ N<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 7 d! e$ ^' [/ T9 m* p
   Enabled = dbg_Enabled
8 ^! o% |, \- F8 f. c1 |End Property </P>& e, N6 f0 i9 H- Q# M+ x% r& A
<>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 * x) j3 j8 _. i6 |" n
   dbg_Show = bNewValue / ^( e  g9 v3 @. {
End Property </P>
- \: P& F- l, w1 B7 e- F" ~! u% q<>ublic Property Get Show ''[string] Gets the debugging panel.
/ d; n+ w  y0 }7 l/ x   Show = dbg_Show   A! H: S: i  A0 `$ E
End Property </P>
0 X4 q& c$ m8 }5 e. V9 ~1 ]* j<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
5 G5 Q( E2 Y2 y   dbg_AllVars = bNewValue . i3 C, V! }8 m, h+ I8 d7 V
End Property </P>
: X/ @/ ]9 R$ I% F. f* y( B<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
8 Z+ @0 h2 w5 G, @6 L  z   AllVars = dbg_AllVars
# }; ?+ F# K7 g8 e3 X5 kEnd Property </P>% Z6 @) F7 r" [1 W4 O
<>'***********************************************************
- S" j+ j2 ]* t% O. Z' T6 Q6 E& I''@SDESCRIPTION: Adds a variable to the debug-informations. $ L2 w9 P# T3 K! G9 Y0 R. O+ s
''@PARAM:  - label [string]: Description of the variable , w' E# h" L1 T4 O5 n. ~! T
''@PARAM:  - output [variable]: The variable itself
( O( b& \1 ]+ ?* A9 Y'*********************************************************** 3 m: K9 x( c( }
Public Sub Print(label, output)
5 {) y# |+ n, `4 u0 `8 e9 `   If dbg_Enabled Then * }" ~: D# f& i5 O& \
     if err.number &gt; 0 then % Y: ^( L9 p4 j- ?. B+ b% [: |
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
9 Y) R4 X, M) e; }. J       err.Clear $ c0 a- ]) T. M# L8 T" ~- m3 G
     else
4 t+ e. D' U4 k) t6 ~& @2 p! l" n       uniqueID = ValidLabel(label)
/ @% u8 N  e3 a( f  G       response.write uniqueID
2 o7 V7 w: \+ P6 y0 R       call dbg_Data.Add(uniqueID, output)
9 ^6 F, j4 ~' y! a: M8 a% H; f     end if
. Q) k4 p6 G& a! U9 M   End If - J8 t6 M6 w- q" O; l* x
End Sub
/ k1 D# ^+ S  M  
: |% @7 l5 n+ h, n'***********************************************************
1 K3 n" V& Q# w* n! E, r9 _' O) ]6 m( ~'* ValidLabel
' f! X9 @/ ?# Z'***********************************************************   P' X! p% m$ \& [6 R
Private Function ValidLabel(byval label) : I' [3 ~, F3 i- q4 d8 v
   dim i, lbl 4 q8 D, W" K3 I4 k8 m
   i = 0
* j5 `" q4 b2 H4 `   lbl = label 7 @( d+ j$ g: P# \+ W+ ^
   do
6 l4 L* |, a0 a   if not dbg_Data.Exists(lbl) then exit do
$ v& d% M( X# a- B% C2 R+ s   i = i + 1
) x& O, }& M5 Z0 F* R/ B7 N* @2 M% y   lbl = label &amp; "(" &amp; i &amp; ")"
# J  l# _: D6 e1 b& ?   loop until i = i 6 o8 M0 C# J2 t4 Q. [* i
  * K  _! ^& a6 J2 V1 \* ]8 M$ B
   ValidLabel = lbl
; {# e0 x2 k% p0 P% W. XEnd Function ( [0 f; Q$ c1 h  _7 R; G
  9 [, {" u: c6 j1 n6 q) `$ ?7 {
'*********************************************************** : R# o5 Z& a$ V, X( b
'* PrintCookiesInfo / l0 J$ K; r0 W* t- T/ L, b$ P# o
'***********************************************************
( _5 N; _" ~$ p  d! z# I# fPrivate Sub PrintCookiesInfo(byval DivSetNo)
: j6 j6 f/ C7 a4 W' m   dim tbl, cookie, key, tmp 8 D1 A" N( M4 a( d6 C
   For Each cookie in Request.Cookies
8 `3 J% z2 G5 e/ l& x: @, d   If Not Request.Cookies(cookie).HasKeys Then
! s" W0 |; E/ t9 U1 \     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
7 t4 A) l+ X, t. U" Z+ [   Else
" J( b- i/ N4 q     For Each key in Request.Cookies(cookie) , @* Z( v) C  @, [/ F0 \* _
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 2 h* e" B5 Z  O) A/ S. l- A! E
Cookies(cookie)(key))   
: u$ d* ]0 Y/ \8 e; r3 f" E' b- ?* j   Next . T  E0 s& U) {$ u; j
   End If
" L5 W* B, m' D- m2 h) }+ z   Next </P>$ R: O; V* Z2 i$ l* Z$ \9 f
<>   tbl = MakeTable(tbl)
- I  E; }9 p( J# C' u. R! }3 Z   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
* q0 {: ?" Z1 o2 e6 W) v  ]   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
: ~, ~5 p0 _/ R5 G2 D- n- I4 S2 Y   Response.Write replace(tmp,"|", vbcrlf) . u9 L' ~; V- E# k' r
end sub 7 T; t& {8 y/ _* }
  
  g' d6 Y) L. ]+ R% w8 I, @& ]" Q'*********************************************************** % r, @: t% q" z2 C$ r% J2 w
'* PrintSummaryInfo 4 A) B" v8 ~4 v8 x/ y1 w- o
'*********************************************************** ; `/ C7 X  A- B# }. q
Private Sub PrintSummaryInfo(byval DivSetNo) " ^5 H: V" z6 L
   dim tmp, tbl 9 k% s# b* {& F' Z2 V
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) % g& ?: ?5 B# ]: Z% t: f) S
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 5 r2 q3 T2 r: B5 G) Y
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
# K% G2 Q/ s, n5 j1 e. _' n   tbl = AddRow(tbl, "Status Code",Response.Status)
- u' k, q+ Q7 W4 w( ?   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) " @& I. F4 W8 S: \7 T
   tbl = MakeTable(tbl) : Z, u2 \% [! ~( U" m$ g% i
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
6 a  T& e$ t: q) h- f   Response.Write replace(tmp,"|", vbcrlf)
% W, |: d$ N& ]6 |End Sub </P>2 F' v0 w/ Y% r0 y* ^
<>'*********************************************************** ; q. O2 n6 F5 I) u
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
4 \% z' I" C' n; \& J( ?0 B) F''@PARAM:  - oSQLDB [object]: connection-object / {  J% y! J9 G$ y, F- X! ]$ g2 J- b
'***********************************************************
/ A9 M: q9 w; Y9 pPublic Sub GrabDatabaseInfo(byval oSQLDB)
3 p- k0 Q( Z, O. z) T5 Y   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) ' `, c1 z3 ]1 B- a) ~
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 2 W* i$ r4 I  H( ?2 x4 ?1 {+ [
   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"))
8 Y) C) u: X! K& A4 b7 T/ h   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) + `2 l- D5 c' Y1 K  v  J( e0 q
End Sub <>'***********************************************************
' ~8 Z3 M7 ?! t% y7 k7 ?$ R# O0 L'* PrintDatabaseInfo
: E) I8 a, ~. }- P  d3 Y+ ~6 F'***********************************************************
1 _  M0 X  [9 z: Z+ v! o/ W! [; {  RPrivate Sub PrintDatabaseInfo(byval DivSetNo) 7 I; K0 F# M( s- i; N0 v
   dim tbl + n1 l$ r. G" r& S+ s
   tbl = MakeTable(dbg_DB_Data)
: }, w+ }+ u5 O! v   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) & f+ K) |3 D) Z4 V9 l3 b3 K
   Response.Write replace(tbl,"|", vbcrlf) 4 D7 r0 k8 M- `' Y
End Sub </P><>'*********************************************************** " d* K5 M* V  E) Z5 L5 S
'* PrintCollection $ F- }% d) e- y- ~% x! g
'*********************************************************** 7 A& }7 z3 s' S) }) Y
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
& L3 r; A+ ~( L# ^+ G: V6 G9 S   Dim vItem, tbl, Temp ) p0 [" D$ w$ R$ C
   For Each vItem In Collection
( y! I' b$ g! `0 h1 s) U     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
3 L" G8 Q8 S% B$ Z0 [       tbl = AddRow(tbl, vItem, "{object}")
! Y6 {+ U( s3 \% |7 @0 |) U% [     elseif isnull(Collection(vItem)) then # O, N9 f  ?% ]
       tbl = AddRow(tbl, vItem, "{null}")
( l$ K5 }9 e( n" m" u, G. R" ^     elseif isarray(Collection(vItem)) then ! O  b8 i9 W. k
       tbl = AddRow(tbl, vItem, "{array}")
, G# d/ x' k  r8 f7 q& d; k     else 0 E) u# q2 v. Q/ c5 ^
       if dbg_AllVars then 6 m1 ]! |& I( g" i0 b0 X
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
* b" P- Y* w2 n6 e9 z& o8 h     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
/ n+ j! Z$ ~) q; D( q. n2 E       if Collection(vItem) &lt;&gt; "" then 8 _+ a2 f; `' y+ X4 _
       tbl = AddRow(tbl, vItem, server.HTML' Q2 u1 g3 I% z5 s
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") # H( R8 B: O# P' t0 x/ Y: V. ?* S* }
       else
$ n, Z+ \( Y4 I8 g6 O! ^       tbl = AddRow(tbl, vItem, "...")
0 I/ j" G# t, F& ?- R/ t( p       end if 4 l: `5 P$ y: \7 e, Z) Q& v5 \
     end if
  S4 P, F+ J# r+ b" s   end if
  u5 u& W: M# b4 D5 f, C   Next ; _$ a- e' c5 a& a! q8 b1 u
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
# K* m7 ~6 h9 [5 U) [5 D2 r   tbl = MakeTable(tbl)
3 W, l+ w6 X: ?: s6 D8 m7 L2 H   if Collection.count &lt;= 0 then DivSetNo =2 ' B0 p9 P- g& B7 Q+ f2 e
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)   ~9 O* F% d4 K) S" j
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) + d' P& D* l: r& ~5 _2 E
     Response.Write replace(tbl,"|", vbcrlf) + A8 l+ ^9 |, @9 Y
End Sub ! l# r" y5 `) @( P
  - g8 ^3 ]8 h( C2 Z+ r7 w
'***********************************************************
" n2 k6 S, `% ?% J' \'* AddRow
) ~0 e5 N( F3 ^8 [3 _. a'***********************************************************
- x4 G. @0 @" A2 [# u. \' APrivate Function AddRow(byval t, byval var, byval val)
0 {2 F) Q# G" n4 z   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
4 a. m, l. L# k; {+ ~   AddRow = t
$ p; [- t1 i' I* {6 ^End Function </P><>'*********************************************************** * f% G9 J/ v$ X8 G) a, l3 b% I
'* MakeTable + ^. V5 N, m5 c) b3 u* q
'***********************************************************
  M) z" S* \3 ?5 ^2 G" g0 cPrivate Function MakeTable(byval tdata)
/ y- I9 ]: S' }% Y   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
. L) X+ h2 ]+ A! [4 W   MakeTable = tdata $ Y2 i1 t2 u' I$ Z( e
End Function </P><>'***********************************************************
3 n7 r5 ^: e/ e- m# X''@SDESCRIPTION: Draws the Debug-panel
8 B  o2 ?" I, o' t3 b'***********************************************************
3 J) _5 l) G, UPublic Sub draw()
" g/ U7 v- q! T   If dbg_Enabled Then
5 e! F# K9 d0 R$ q4 g7 A     dbg_FinishTime = Now()
1 r$ o# w6 `% f  9 g" `/ @3 v; y+ Q, A6 R7 ?
   Dim DivSet, x # k+ E( F% }  A3 L' d4 r
   DivSet = split(dbg_Show_default,",") 3 X; ?' ^; \2 w( K! ]2 d9 Q
     dbg_Show = split(dbg_Show,",")
: c% R2 m4 O# g1 }. C5 t  9 a. h: E; I8 D# P  q
   For x = 0 to ubound(dbg_Show)
: \3 m8 ~0 w8 i- }, q" ]" E3 Q! x     divSet(x) = dbg_Show(x) 5 \; B5 ~+ w# I* }2 P
   Next
/ a( h+ W* ?1 b4 b2 t( C  % z$ Z: B  c7 V
   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;"
7 O. S9 g0 e" W/ ]9 O9 D5 u   Call PrintSummaryInfo(divSet(0)) 5 K; x7 n0 H5 V# j; Z- o* C
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") # J# n$ D5 b6 F' X
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") , K; E9 p1 c5 B1 M6 c
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") . l8 ]" r$ u$ h
    Call PrintCookiesInfo(divSet(4))
& K+ L* e+ z1 U: X2 c8 Z    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" S0 H; Y8 f" i, p/ A
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") , y$ Y' L+ U' M3 h! w1 l% ^
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
/ j5 J9 t4 q5 d; x    Call PrintDatabaseInfo(divSet(8))
+ _$ r  B) |+ E" I( T% I1 q    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") " O+ E$ M  s, ^$ Y: t$ Z2 b5 N
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 2 x2 y; h! J3 J8 U2 \8 t& ?3 ~3 k
    Response.Write "&lt;/Table&gt;"
- E0 i. i% L) F2 w% E   End If 7 ^, f& d$ I% n3 B+ l
End Sub </P><>'Destructor & b: B, f% A- _+ R; k; X: P
Private Sub Class_Terminate()
4 e1 w  V- ~5 T  M. o2 B   Set dbg_Data = Nothing
# E5 ]) Q9 A% L4 |. tEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
- [* W- U7 q' J# _* iCLASS debuggingConsole   a2 D9 V; n9 }  T1 k
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false . y7 T, o" j3 `0 g: i# J% t
&amp;n, v" o+ }  }& c0 U, G0 ^
bsp;
3 m) ]# c/ h% [Property Get Enabled===[bool] Gets the "enabled" value
4 u( E8 f. u, \/ M; f$ Z  8 W% F6 c( T7 W5 s8 q* z
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
' h; r' `0 l8 {# y* G6 m% O  
. O* z5 d: }0 q: `- [6 h( E" e- K4 FProperty Get Show===[string] Gets the debugging panel.
/ G" a% P4 l. m4 `5 s3 f  
. }$ q0 E- d. C2 X1 N: R& yProperty 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 u" Z- W: r4 J/ ?Public Methods </P><>public sub===Print (label, output) . @5 U( c9 o+ k8 `  G: @4 j! z; e. `
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)   F& u$ X  X/ g0 }  O& t
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
) _. ^# ~3 y2 ~8 R  v   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
; P/ w! V. H6 o( W& L5 D$ {, w. YMethods Detail
% p$ J3 z. |) S' E  9 [1 G1 F; l2 F9 t
public sub===Print (label, output)
$ P3 V* j( k# P8 EParameters:  
3 n( o7 ]# K# r8 {2 ~' |   - label [string]: Description of the variable - t& a' k& V# d7 H/ s$ o6 n
   - output [variable]: The variable itself 9 I7 J4 Q% T. f) Z" a7 u& n0 h* o& J
  
: P5 G" p2 `/ ~public sub===GrabDatabaseInfo (byval oSQLDB)
  D) C+ w3 N* J+ b. vParameters:  
& M. f- T/ c" U/ R6 e0 J- C   - 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-7-19 19:13 , Processed in 0.871544 second(s), 56 queries .

回顶部