QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>$ ?5 I9 {0 M6 i7 O; f, {
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! $ e! x' r( S' N+ s
使用方法很简单:
! u: Y* e  @* gtest.asp </P>
/ G2 i2 {5 S  U, [/ _, F# t0 U<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
: `8 ^+ X+ ~, d- ~) ]$ W&lt;% % v0 {* }+ p3 o. C* G% T
output="XXXX" ! V: c: X) Q/ d/ M3 _
Set debugstr = New debuggingConsole
" N# f. k+ k+ X2 c9 P3 s$ sdebugstr.Enabled = true   ?, e1 k1 T3 l2 ?7 f( k$ D
   debugstr.Print "参数output的值", output 2 n; u% s" V* m7 c, t- S% o  M
   '…… 5 A% p: d6 G; ?% Y  L" ~' M
   debugstr.draw
; d- }* ^( v% z+ G; G6 \% `) NSet debugstr = Nothing + E0 O7 H4 S: O4 P9 D' p
%&gt; </P>
7 N. O8 Q. ~& w5 M5 h" _! \<>=================================================== </P>
$ L8 T9 x, ~- u: H* g<>debuggingConsole.asp </P>
# L$ T5 \8 M& p. `<>&lt;% . U0 h' h+ {0 @
Class debuggingConsole </P>
- @1 Z3 ]# ^+ k  U0 P' _. p<>   private dbg_Enabled - d# U6 p* D. A& ?8 Q8 K& V- Z. V
   private dbg_Show
* d8 _$ D0 t% |3 u   private dbg_RequestTime   `2 u- t2 f- [* E
   private dbg_FinishTime
2 J8 [$ x* K: l! K1 e2 h   private dbg_Data
4 O" H/ z$ N$ ]3 @5 ?  h4 `& w   private dbg_DB_Data
, E% ^8 `+ I+ ~  O  K% p, b   private dbg_AllVars 8 _1 {7 E2 l  ]% K  ~0 t- E
   private dbg_Show_default % q6 i# y5 i3 Y3 r) W* s1 I: q5 h
   private DivSets(2)
8 S9 N" A' \5 h- r4 ]7 B   ! J3 @/ ?# C3 x8 u! b
'Construktor =&gt; set the default values
3 i! [' y# H; w8 |0 _Private Sub Class_Initialize() 9 V7 K+ J3 M: T6 u3 b9 K) P5 ~
   dbg_RequestTime = Now() , Q5 F% C. N+ H  C# N/ U
   dbg_AllVars = false 6 g1 m& x; e! X$ w5 E1 U6 b
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
2 U; ~7 c$ B" s8 z; x<>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>9 x4 T/ ~# f- ]3 n
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;/ n. t& K" M5 Y! g
&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>' t) B7 j5 t7 Y. ^& x) S
<>   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>
3 Y; _& ?8 b9 D0 U<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ) {( j; r5 s& Y- x( U% S
End Sub </P>- Y! _# V: O6 ]
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 2 Q1 u8 A" I* \1 z
   dbg_Enabled = bNewValue ( T3 }& i/ \8 p" K. v
End Property </P>8 S9 {) c) ]2 [1 g/ J; T- p
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value # {' ~  {/ x1 t/ C) |
   Enabled = dbg_Enabled 1 g/ V& ]; `" H$ m$ s2 H
End Property </P>
* O# M. g# G# w  H. H<>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 . f! h5 i1 c5 {; ^
   dbg_Show = bNewValue ' A; a( v% D& Z* p
End Property </P>& Q  s7 Q* P/ a  @8 ]" V
<>ublic Property Get Show ''[string] Gets the debugging panel.
9 l4 W) W  J' p+ j' @2 K; n9 Q/ f   Show = dbg_Show ' S) D9 d7 c5 C* n
End Property </P>
% B. C3 {) E7 Y' E- b# t<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 2 |% o# [% _1 s* A8 M( ^3 d
   dbg_AllVars = bNewValue , {! W- e. T1 h' i
End Property </P>
' A+ y, S+ f) o( h<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. % y( ^; R. H0 ]8 {2 @9 R* p* j
   AllVars = dbg_AllVars
: C* h/ \. R+ k. r$ l# G& b7 UEnd Property </P>8 w5 V. f5 T8 x
<>'***********************************************************
. U1 Q. z' C6 o& r3 r; Y''@SDESCRIPTION: Adds a variable to the debug-informations. ' O$ X3 F" L) E
''@PARAM:  - label [string]: Description of the variable
9 I5 e0 F+ U; L' M: m" ?6 w''@PARAM:  - output [variable]: The variable itself & f) U8 W5 Y4 ^0 t, u9 k
'*********************************************************** 1 a/ Z3 m$ l+ U. i7 c$ A
Public Sub Print(label, output) ) z/ A: F' H  S, w* ?$ h( @% W
   If dbg_Enabled Then 7 \1 Y. B1 J1 W7 f, ?7 S
     if err.number &gt; 0 then & s$ J0 G9 \1 c+ {, n$ r% k# f% h
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) . `5 Q! g& ~8 j! E3 e" U
       err.Clear , O8 E5 M+ }$ v3 z4 ~9 G2 u
     else * l, |, H; P' ^) J; k
       uniqueID = ValidLabel(label)
) B* A2 B7 T" c' c; S1 ]# b       response.write uniqueID # q$ ^4 L- p, K) _! L
       call dbg_Data.Add(uniqueID, output)
5 `. U: d( _% f2 y: h3 Y+ n     end if
& J8 j0 b* g# A2 p/ J# ?   End If
* Y7 Z: K; t% T  L0 UEnd Sub 1 u, x5 [  e, L3 f
  5 F$ H- R% k5 c! Q
'***********************************************************
9 {  a8 a( S4 k, W9 e  _" I( B% t) }'* ValidLabel
; i& u: V2 l: z; t+ n) D1 T'***********************************************************
$ I( P4 o" S6 u8 W$ mPrivate Function ValidLabel(byval label) ( x$ G! y! l' J- o& n( H) f" L  w1 M! B
   dim i, lbl
3 l; z+ A8 d0 X3 W' \# C   i = 0 8 O* u" b" Y4 G) m+ u6 l( _3 J
   lbl = label 1 t! L: B8 S/ ^( b8 J' [' G) A  u
   do
+ T  d9 K- X- R# H7 M% A   if not dbg_Data.Exists(lbl) then exit do : B# ?; b0 a( M) p7 R* Q9 c
   i = i + 1 ! g5 Q5 ^0 C4 j& ~
   lbl = label &amp; "(" &amp; i &amp; ")"
9 S8 g, G5 S9 o" l, ^! Z   loop until i = i
& x% w6 m8 i, _0 ^* n  
/ B1 l# g' {& n) y3 d0 Z   ValidLabel = lbl
! U3 u9 A3 H6 K) S2 g$ j5 n" wEnd Function 6 w, k7 l: P; |. r1 H3 `
  
. S  a; E) t* R0 E; ^( p5 H) X2 q'*********************************************************** 3 W  e( e7 Z. |) j; d) g" E
'* PrintCookiesInfo
# }) y1 z1 Z' F! d1 Q! F  {'***********************************************************
$ [$ K" m: ?9 n: S  ?Private Sub PrintCookiesInfo(byval DivSetNo) - Y. b! _. ~* P3 C
   dim tbl, cookie, key, tmp
# p& y7 R7 J- Z   For Each cookie in Request.Cookies
  _- K/ Z% O& @% G5 D6 z& k& S   If Not Request.Cookies(cookie).HasKeys Then 3 c+ M3 S: |2 v/ t* z
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   , T9 A; X5 N- c3 M; e" {" _
   Else , |# \( U- {6 r) r5 F! I
     For Each key in Request.Cookies(cookie)
2 |+ f% O( y/ D     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
, b) q. q- }% }9 R% m) B; b0 Y5 ECookies(cookie)(key))   ' F/ [+ z4 j3 a6 M
   Next 0 d! {8 a* x0 T6 r2 l
   End If
1 h: T0 I1 B0 d; v+ u. B   Next </P>! J7 t9 i8 A4 z% y6 K$ q
<>   tbl = MakeTable(tbl) 6 z8 Z& p# y: F; l
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
6 i5 m# y/ U& @  d   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
& Y3 j1 m) u+ J9 X7 k   Response.Write replace(tmp,"|", vbcrlf) ' P9 H9 s4 O1 y2 c: u" P3 W- L7 r4 l
end sub
! j0 e: [/ s7 Z# f9 ]# }( F  . D& R. O/ V) i' A
'*********************************************************** 5 |/ {* z; r* G1 @) `
'* PrintSummaryInfo
: R9 F  |# M! l+ C0 k'***********************************************************
& P: C3 }" ]# MPrivate Sub PrintSummaryInfo(byval DivSetNo)
& Y" p+ {5 C$ {& c! s   dim tmp, tbl
7 g# i6 Q( p+ e' x   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
$ g, K, o$ S- f' L   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 6 M8 J; m- V+ @/ k4 v3 H( [! ~
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) % {& m2 A8 o$ K$ O+ B% u
   tbl = AddRow(tbl, "Status Code",Response.Status) # \" t& `9 l% t: r' _1 [! A" Z& r
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
1 V4 _9 U% M5 T   tbl = MakeTable(tbl) 6 Y$ _; R. t* ~" }6 ~" G4 O: o
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
+ ~( {$ i! p, ?- ^' v. ]# @) @9 h   Response.Write replace(tmp,"|", vbcrlf) 9 o8 r" I( [8 M  m' \( c
End Sub </P>
3 K0 M, \) Y, g<>'*********************************************************** 4 I/ R1 j! z% _3 q7 E; s
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
% X4 J# c3 T# Q' X) j/ D/ Y3 ]''@PARAM:  - oSQLDB [object]: connection-object
, {& \$ `  @3 X'***********************************************************
' t, N0 {3 y6 S, m7 h, u7 X4 PPublic Sub GrabDatabaseInfo(byval oSQLDB)
( R, n8 q' u/ i/ ?   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) # ^5 f9 b- \, U5 M$ v1 B! M
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) + @1 @. b, x7 @% Q+ y
   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")) 9 T5 I; W' o' ?4 o. Z. {9 v6 e
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) & S# o- H; ~$ P
End Sub <>'***********************************************************
2 H/ b. L0 P: J% a3 F4 W'* PrintDatabaseInfo
, ]/ F' M' l* Y% o. C'***********************************************************
/ e' b  Y( i9 E! c- h+ T9 kPrivate Sub PrintDatabaseInfo(byval DivSetNo)
5 R. z) S+ o# Q, a* v" {   dim tbl
8 p; S" w: g+ \   tbl = MakeTable(dbg_DB_Data)
. u% E% W! P5 v5 _3 u   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
. U$ R+ m, z; Y7 g8 Q5 I1 {   Response.Write replace(tbl,"|", vbcrlf)
6 t/ s: _( W; h5 c& r: x# pEnd Sub </P><>'*********************************************************** 4 [  f4 d; @, |$ r8 G9 U
'* PrintCollection
% l% J7 t' t) F5 M'***********************************************************
8 Z! v. t; y8 T7 y4 S" JPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
* s8 k8 @- D! {1 E   Dim vItem, tbl, Temp
- E5 Q& `/ ^6 T: D( f   For Each vItem In Collection ) w' k) L( n% k0 F
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ; e" s7 F) z6 R- e/ {
       tbl = AddRow(tbl, vItem, "{object}")
& y7 A1 [. p" \" C( z7 |     elseif isnull(Collection(vItem)) then
5 z+ [/ B1 P8 @" l" Q  S  i% Q- c/ C       tbl = AddRow(tbl, vItem, "{null}") : N! Q2 Z! ^& L: I
     elseif isarray(Collection(vItem)) then
3 Y8 i. b+ V% Q: D! b; `2 k# u       tbl = AddRow(tbl, vItem, "{array}") 4 [8 [* D- m! p. ~8 m. r
     else
3 h9 k5 c$ n& Z       if dbg_AllVars then
2 l8 W3 V$ x( w- |       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) ) s- b5 a: E+ J  c3 ^! e3 \3 D' u
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then * S, z+ m$ w2 r% P7 Q
       if Collection(vItem) &lt;&gt; "" then ) Z" L( l( a5 ^8 P# `: U
       tbl = AddRow(tbl, vItem, server.HTML
" h0 R. v1 s& sEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
# c$ [- g  T6 R7 G       else 3 }3 @1 K, L) G2 {& x+ a
       tbl = AddRow(tbl, vItem, "...")
2 |7 e) z- _8 V  v" L7 R" |  X       end if ; S% w8 |$ s( l4 k
     end if
+ d* o' Q" p4 v7 o7 u   end if
  f3 C- n9 A" }6 _2 K" |2 L   Next / ^) t; \! ]5 W9 ?; f/ r
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo / n% r0 z& y) p# x; g7 a
   tbl = MakeTable(tbl)
' |7 }5 {0 p0 h) e5 d   if Collection.count &lt;= 0 then DivSetNo =2
0 q. b) K4 ~+ g     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
  w3 C' D, k* O( ^% p     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
& D7 Z9 M- |8 h: A$ r% T% T& p+ |     Response.Write replace(tbl,"|", vbcrlf)
9 |) h- f+ A$ J4 QEnd Sub * }+ r/ c8 v7 @$ {7 m8 _- t% F
  8 b( Q" M5 L: }# f" N
'***********************************************************
5 v  ~$ n0 I- j  j8 J6 C'* AddRow
/ V/ Y3 z) J3 O5 m'***********************************************************
+ x- |) F% g4 T9 q1 S& CPrivate Function AddRow(byval t, byval var, byval val)
& a' M+ ^2 I2 K- K   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 8 k5 b1 E: G* t; S3 _3 c+ P
   AddRow = t : [$ j* x& F- X& X# q7 w8 u
End Function </P><>'*********************************************************** % y7 M/ z$ R) m( g, j- k
'* MakeTable & ]4 j  i7 p; ~* s* o
'*********************************************************** 0 k; E; N0 F- U5 `3 l* |) l! H3 J
Private Function MakeTable(byval tdata)
3 f" r5 b$ U' R! B5 D+ k   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
4 V- \8 M* l  J" \   MakeTable = tdata $ L7 K+ y9 D  X8 p& x8 U
End Function </P><>'***********************************************************
' }" u8 l5 J8 o( ~2 C1 J# F4 f''@SDESCRIPTION: Draws the Debug-panel
) {6 _' E: w! K% V* w+ B6 c' q'*********************************************************** " C9 I5 K6 x- m* O) S: W% P; k
Public Sub draw() / r* W+ p2 |, z9 J5 z0 g
   If dbg_Enabled Then 5 A+ u: O1 ~- Z4 f" q1 c/ j
     dbg_FinishTime = Now() ) h- ^) q  S7 l7 ]" L0 U
  
# ~6 ]4 ]% ]4 ~, @1 J  i4 g   Dim DivSet, x
2 I* F7 q' C- {2 r) e   DivSet = split(dbg_Show_default,",")
1 ?+ l1 X3 G  A  m" M) V. p     dbg_Show = split(dbg_Show,",") 3 L$ q2 `3 q2 m6 {
  
% M: _2 n3 J% Y( [0 o7 d8 {$ X2 ^   For x = 0 to ubound(dbg_Show)
& ?. ?. o( L( a2 ^5 p7 ]     divSet(x) = dbg_Show(x)
! E7 m7 r7 W6 B, p, V   Next
; x5 t, [2 J/ @! z0 S  & ]/ P$ _* }& K7 D- m2 d3 M
   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;"
* ~2 C5 |- ]3 ?4 a3 U   Call PrintSummaryInfo(divSet(0))
3 H. y0 F0 j5 W7 V, s* T0 N) H, s     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
: K  v' M, B4 T. o  `8 }; x    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 3 G" J- U$ F& c% L& T9 e7 r
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 z6 X, t2 G. Z7 z7 a    Call PrintCookiesInfo(divSet(4))
- K" x2 b. y' L    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)) 2 c  x5 k2 [9 Y: P
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 6 o6 S8 `" z" W: `3 u
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
2 f$ g% k2 L& f3 d5 Q- D# e% ^    Call PrintDatabaseInfo(divSet(8)) 7 S9 z3 H" S1 \) [
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
0 V3 `- g: W2 S/ Q. n% W    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
7 L8 b( Y9 _& z: y$ A2 }: N    Response.Write "&lt;/Table&gt;"
; ]$ n5 `* D" J& C- e1 w9 x   End If ! u, B/ |( u1 N. C6 a5 c2 ]7 R
End Sub </P><>'Destructor / e; r4 e' Y) f0 S- |/ K# ~
Private Sub Class_Terminate() / U" P  m6 Q# p) Q$ U& e
   Set dbg_Data = Nothing $ B& I4 D4 g0 f, q' e4 r+ v; i
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>1 V+ O0 p! ^2 j+ U
CLASS debuggingConsole 3 s2 F8 U+ G5 E! e  Y
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false - k* A  i- _  {5 O0 L2 i
&amp;n
, x) L  a* u& [0 d: Y" d1 zbsp;
; s3 g; ]( H7 I- EProperty Get Enabled===[bool] Gets the "enabled" value & _$ `$ q- J6 z6 [' u; B+ ^
  4 C$ K. y6 U9 p4 v6 q
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
" b% k" K- v5 l8 f  
. T, n6 ^" T$ S$ xProperty Get Show===[string] Gets the debugging panel.
3 A6 {; _3 e1 B/ e  3 u4 J# ~( J, H' H
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><>-------------------------------------------------------------------------------- 0 G: J+ j! n$ J9 ~
Public Methods </P><>public sub===Print (label, output)
% e$ A, i6 s- Z  c' U   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
6 w* Z4 I. R; o, S* G   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
8 q! g9 ]% A/ }2 H   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ( `9 n1 S: z: c! d" q- U
Methods Detail 5 ?: O# H4 g7 I/ @* L
  
( K8 T/ V, H0 O( J0 R) I6 k! j- Jpublic sub===Print (label, output)
6 A( |( D# D6 DParameters:  3 h; ^5 z* c3 Q, z7 e
   - label [string]: Description of the variable : A/ z- e' M3 ~
   - output [variable]: The variable itself
, ]% s% r2 b7 J  
. C3 r! A- d! _6 S4 m% opublic sub===GrabDatabaseInfo (byval oSQLDB) ! {6 Q; c0 n: B' Z. F& Q0 [- A
Parameters:  ) X) T( ]+ `: [' 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, 2026-1-4 23:14 , Processed in 0.410374 second(s), 56 queries .

回顶部