QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
" _* Y4 Z% X1 _<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! - j1 G  A8 [2 Q6 I) p; g# h, s
使用方法很简单:
( s- M( N% B) l( ttest.asp </P>
0 R% Z3 _7 \; [# X# j9 V& a; r<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
  c5 l! h# F1 t& l2 s. U8 I- d&lt;% 9 `8 @4 S2 Z9 S# I5 f
output="XXXX"
6 ~2 r8 G6 s, Y# `& LSet debugstr = New debuggingConsole
) t& d6 a5 E0 l6 v2 H1 D0 ]debugstr.Enabled = true
: b1 w& q4 f; [2 ?) i8 ?/ h   debugstr.Print "参数output的值", output
6 o) d" W8 F! A; F- Y& d, V! D   '……
7 g5 J" f2 n2 p# P- k  F   debugstr.draw
  Q) P5 s6 P( S+ L/ q: }, e7 p$ {: DSet debugstr = Nothing ! B- ?! E. b( V( r% s/ d) D. q* h
%&gt; </P>
# d; y( s# m" Y6 D* @& D<>=================================================== </P># P% _# {. [9 B" ?
<>debuggingConsole.asp </P>
! x  Z# P, ~7 f: ]9 y8 ]<>&lt;% 7 n$ h5 r. E# [+ f9 [
Class debuggingConsole </P>; T) c* m6 f) Z& j9 l% E
<>   private dbg_Enabled , f: W/ d( Z9 E8 w+ t
   private dbg_Show ( ?6 U  r8 M+ G, N, o0 k: p
   private dbg_RequestTime 0 w+ I) W# b/ g; s3 C; n; _) \, |
   private dbg_FinishTime ; o; W+ ~& ~; I. Q* x
   private dbg_Data / Z; Y0 V# v4 v
   private dbg_DB_Data ' K- B* }! ]8 D  {) w1 X7 x
   private dbg_AllVars
+ f0 P" D. J" f   private dbg_Show_default
1 K6 h, D; K: D9 f, E   private DivSets(2)
+ B3 `& R( {1 \4 C1 r3 ^   
; Q! K6 {, ^" L3 j2 Y8 y'Construktor =&gt; set the default values : w2 R' _8 O; o  B* d% n( W
Private Sub Class_Initialize()
+ W! o4 i: w/ `. A5 Q7 V. K1 }   dbg_RequestTime = Now()
/ L, i3 N* c$ N   dbg_AllVars = false ' z5 p' y# b0 S6 j  [& J6 V
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
$ L- D+ t( L( r<>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 N% w. x9 q" y' r+ t<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;  a$ M! g# W6 K5 I" I
&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>/ ]" M, c; S/ P6 C
<>   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>
6 ^4 N2 {3 \7 h% U<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
0 N5 _5 e" d1 N- vEnd Sub </P>* N: q8 i' B% V
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
$ w6 J/ }3 z" F   dbg_Enabled = bNewValue
8 x: `2 q& Z( d$ O# I. hEnd Property </P>1 y& g" E) o; ]' r, {( z' e
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
' c5 u, e' h5 Y& ~0 R  \   Enabled = dbg_Enabled
( b5 H: b0 ~2 P& }' J; vEnd Property </P>8 G( G7 R. J; w
<>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 7 {% N/ A* Q4 i# X3 i$ o
   dbg_Show = bNewValue 3 ^' t! J4 G( K9 V$ X
End Property </P>$ E' s+ B2 Y: b! v- ]
<>ublic Property Get Show ''[string] Gets the debugging panel. ; R( a% ?! m0 A) L/ @
   Show = dbg_Show 7 x+ K) w. c5 n+ E) g& j3 }
End Property </P>) x2 a3 Y, U9 Q+ _0 Q& \+ d
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
% f! B' i% ]% |8 u/ ?   dbg_AllVars = bNewValue
, i* p* h# p# F* m7 ?End Property </P>! H8 X) X2 r( p% O) m- M
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
. S' j! l$ \5 H0 [, [' P   AllVars = dbg_AllVars 6 ^1 M0 e# k6 O& {7 B* _3 l% X
End Property </P>
0 v' o+ l4 w) U; J5 u' U& S9 _7 M2 w<>'*********************************************************** ! J/ ?: ^/ H1 v5 j4 |4 |
''@SDESCRIPTION: Adds a variable to the debug-informations. ' w  q- p2 N" p
''@PARAM:  - label [string]: Description of the variable
4 o% o* T! ~3 s" P: W0 j* h''@PARAM:  - output [variable]: The variable itself , d( y* G# w5 H6 w& }
'***********************************************************
' T0 q' b1 N- U; ZPublic Sub Print(label, output) & `2 l. A4 ]9 b6 I  f) T2 W, V
   If dbg_Enabled Then   D$ E3 t2 ?0 \3 i
     if err.number &gt; 0 then : R8 ^7 |+ Z% N% E
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)   v* x1 ]# M/ j. o2 c6 a
       err.Clear ! q- O9 z$ }/ V
     else
/ s$ S* u6 n2 R+ ^* b! z       uniqueID = ValidLabel(label) 2 X. W6 i0 m# N0 A' i+ c% v
       response.write uniqueID
; A0 k; o. T$ ], |  C       call dbg_Data.Add(uniqueID, output)
! A; E/ y( T2 |) ^1 `1 N8 c" ~     end if
8 `% Z: V- J1 e4 d) L   End If 9 s/ _: q; j! e1 d& N1 z
End Sub , W0 x1 S) j' f0 J7 i0 _: w
  
) ]7 j( M, c' [5 v/ p'*********************************************************** : G, [3 y. W: U5 h) r  ^6 q0 F
'* ValidLabel : m2 _4 T6 [9 q0 C0 b. w7 R
'***********************************************************
) t; s" c" [  KPrivate Function ValidLabel(byval label)
4 U- K8 B4 L  _+ {6 F. k/ ~: \   dim i, lbl : u5 Z7 Q- a5 b
   i = 0 4 J# {; T( t, G% k& [
   lbl = label
4 i) z6 G5 u+ h" f   do
, l6 J; f/ H2 r6 h) n0 X% E   if not dbg_Data.Exists(lbl) then exit do 4 ^$ c+ y% x5 X' B0 m7 T
   i = i + 1
  B& {2 h1 ^  d$ z1 ]* B$ Y   lbl = label &amp; "(" &amp; i &amp; ")" 1 _% @! a8 ~# Q* b5 l2 [
   loop until i = i
: D/ l6 M% l& ~# D  i: M5 D9 R  % t) F! F5 \% ~2 i8 X# \
   ValidLabel = lbl / c" w: @4 o9 C* Z- Q# T; {
End Function * G5 U# \0 K( _0 ~
  
# c/ \% W- K) T' K, h, C'*********************************************************** + c" O  g. I' E. [# |; v2 r
'* PrintCookiesInfo / e# F: [/ G  b# y) X9 g! f9 y4 \; D
'***********************************************************
& `  ]/ S' n7 Y. j! U- K& d  NPrivate Sub PrintCookiesInfo(byval DivSetNo)
" x8 S. m) |* m4 n" n& g/ `   dim tbl, cookie, key, tmp
/ |* V$ K" r$ P) U   For Each cookie in Request.Cookies
1 V2 c' j- ~8 Y) C   If Not Request.Cookies(cookie).HasKeys Then
+ h" J7 U7 ~- [9 s2 v$ d     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
- T+ F9 X- I/ d2 m   Else - ]2 H' U( Q3 u. _( m: \  u
     For Each key in Request.Cookies(cookie) ) J" J6 s2 b, O3 _+ ^6 p
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. & e2 K- J. o$ ~' o, Z  T$ B
Cookies(cookie)(key))   
  Q1 [" W7 T  d. w   Next 0 h) B" ]# ?0 t: k( l
   End If
. n5 I* Y) X: }; a5 h# L9 z7 V   Next </P>
+ g6 t: `9 m+ H7 r' Z<>   tbl = MakeTable(tbl) 3 x% o4 i0 n6 f- b3 T) ?3 x
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 9 v. {- w- I7 `0 J$ j4 P
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
. \& n7 m9 [! M$ ~   Response.Write replace(tmp,"|", vbcrlf) 0 z3 r3 L3 W4 H& Z# b% V
end sub
  H/ w; H) O- V6 _! u- d  
9 \8 j9 M% z5 P'***********************************************************
' d2 v2 s4 S" u) X, S'* PrintSummaryInfo , j/ v4 [# o, j' P+ Z7 M* O2 Q
'*********************************************************** 4 r+ {8 d8 A8 ]$ `; Z4 K8 a
Private Sub PrintSummaryInfo(byval DivSetNo)
' x& T1 M3 x# o   dim tmp, tbl $ h; S6 f. U1 }7 ^& y
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 7 w2 a. _9 s/ K. U; D: H7 P. Y
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
# O( m1 C4 g- y+ c   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
) h% b5 C0 Y% B# ]% h   tbl = AddRow(tbl, "Status Code",Response.Status) 4 v4 ^# e+ Z# ], ^" _5 Q/ H7 u
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) / G2 w/ O4 t+ V2 U- A
   tbl = MakeTable(tbl) ; x' p# i5 _* b6 R/ i4 l
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) : U% k5 H2 i/ f3 k$ `4 X0 L
   Response.Write replace(tmp,"|", vbcrlf)
, w* i8 n4 a, ?8 ^* b: Y* }& JEnd Sub </P>5 F6 |' P% F+ M6 _. Q8 b
<>'*********************************************************** 6 Y2 [: m; T. u# w% C: M& _5 b) a; P
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
% b6 p# T6 T# _. f$ a  ?, U''@PARAM:  - oSQLDB [object]: connection-object ( X: @5 g& S" b  t( W
'***********************************************************
* s' T7 x8 O; v9 SPublic Sub GrabDatabaseInfo(byval oSQLDB)
. T' I0 \9 D" N6 l) U) U( K8 X% O   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 4 C, s: N2 q3 n8 w
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
/ j* Q3 A( Q* u7 X; \' D   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")) 3 ]2 |4 f6 x2 E; {8 Q2 ]
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) $ R) w* Y% q" X
End Sub <>'*********************************************************** 1 T3 j5 ~1 H3 F4 T1 h2 `2 O$ j0 v
'* PrintDatabaseInfo
2 N! B7 ~7 R: r5 Z* x6 O. ~, v' L. `'*********************************************************** ( b, ]: H2 `+ Y8 Z
Private Sub PrintDatabaseInfo(byval DivSetNo)
7 k/ ^$ [; J3 q& G, _/ P   dim tbl
! W) y8 u3 S6 T. f& I   tbl = MakeTable(dbg_DB_Data) 4 F  [5 o3 }) Z8 o5 z
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
" _# z7 }' U( R- K: U/ f' U   Response.Write replace(tbl,"|", vbcrlf) ) j! I1 }$ V: C0 f
End Sub </P><>'***********************************************************
2 {+ g) }- Y2 e; b% `& e'* PrintCollection ! }. ]0 \; l  o+ t6 F3 F5 i0 `4 I
'*********************************************************** $ L5 D; k- e9 C) `( |+ h) S5 I) Q
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 9 c  g$ L- I& J- A& V
   Dim vItem, tbl, Temp
+ I  e3 I5 Y% F   For Each vItem In Collection
0 o+ C- G, I8 b     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
7 v  m, U5 s3 [5 \2 ~! Y2 f       tbl = AddRow(tbl, vItem, "{object}") + W4 F9 W5 E/ L% B
     elseif isnull(Collection(vItem)) then
" y# u8 j; {4 b- l4 S       tbl = AddRow(tbl, vItem, "{null}")
% q( d8 b7 M) M! V! Q     elseif isarray(Collection(vItem)) then $ U7 L% ^0 z. k$ x4 f' J7 R- q
       tbl = AddRow(tbl, vItem, "{array}") 1 u, X. n' m0 g( u0 }* [; W2 z" Y- ]
     else
1 G/ D) g- h- Y       if dbg_AllVars then ! y: k0 B8 U$ c9 J2 k3 Q6 K
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
6 n- t+ f# I) N. l6 y& X     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
' w) p1 p( ?, P; |7 A       if Collection(vItem) &lt;&gt; "" then
, w8 P2 v! d5 D1 M5 {1 \8 ?- m       tbl = AddRow(tbl, vItem, server.HTML
+ p7 {3 g# s* H3 o1 [3 bEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
, v' q- {: m' i4 L/ P0 r6 H" t1 ^9 {       else 1 K+ g; J# W6 R5 ~+ j+ B  c( I
       tbl = AddRow(tbl, vItem, "...") 9 J, A, n; k! E# G5 R
       end if
' f  H" Q9 `$ o     end if : F" B' c$ M7 Y6 }* J& G
   end if
: B2 _, E) m4 n   Next
5 S9 T7 v6 T9 A   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo ( R9 S0 S& E7 ?( a2 k  [
   tbl = MakeTable(tbl)
' H! F8 Z9 t" _' t% Q: S, C   if Collection.count &lt;= 0 then DivSetNo =2
$ R( b/ ~7 P- I4 m" o. P- f7 k# J' b9 c     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) * y2 u; z9 p  r7 J% W8 L
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
. j! I3 s! l- Q% l/ g1 u' v, r% X0 E     Response.Write replace(tbl,"|", vbcrlf)
( S  N- n  m- ]- Y4 VEnd Sub 6 w1 `! Z& Y. }" D2 Y
  3 X5 i1 T5 K7 y  V4 p
'*********************************************************** * a+ d( M, ]! M7 _
'* AddRow
$ [7 l3 {) \8 U4 E* c9 T4 X; N: D'***********************************************************
7 Y, y' j3 ~. E) D+ B+ APrivate Function AddRow(byval t, byval var, byval val)
; }- O' Y- }5 }( `" {7 a   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 1 i$ }- j& [% d: I: S
   AddRow = t
# p" n6 w2 @7 \/ G7 Y. |. fEnd Function </P><>'***********************************************************
+ H* |* k4 Y8 {+ h  ~/ f8 x'* MakeTable
0 L4 I( S" j/ B( f& \3 B'***********************************************************
5 ~4 m9 U5 w$ B1 S& U7 MPrivate Function MakeTable(byval tdata) 0 T& d, |2 i8 ^, V; P# g3 m/ \
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 3 G% Y( I* C1 K# Y9 x4 Y& ]
   MakeTable = tdata
5 t2 `% `$ D5 B: }End Function </P><>'*********************************************************** - W8 S& r# }  I; u3 M& g
''@SDESCRIPTION: Draws the Debug-panel 8 P+ y# C) d+ _  s0 E
'*********************************************************** 4 v% i$ J1 K3 v- D6 r, s( p
Public Sub draw()
/ D6 s3 W# g, J/ L, S   If dbg_Enabled Then   h% \% z/ a  H7 W
     dbg_FinishTime = Now()
/ F4 x! l; \$ M" U9 d  
$ j5 H( C; T; I+ h& S: V. z   Dim DivSet, x 3 L3 m$ k  f5 d8 V
   DivSet = split(dbg_Show_default,",")
0 K9 g! m0 ^; {6 d2 q" i$ X0 p4 h     dbg_Show = split(dbg_Show,",")
4 w- P& O: ~/ ^* p8 N  
8 W3 T3 ?* V: o/ W% ^# l   For x = 0 to ubound(dbg_Show)
& @4 r+ {6 q+ a0 j. {' K     divSet(x) = dbg_Show(x) " F4 F* k0 f  p0 _" z  }1 ]
   Next
: k7 M& b3 R3 d  
( Q( _4 J" g; m- }  t   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;"
) L. y4 E7 Y5 S! g  i* _   Call PrintSummaryInfo(divSet(0))
3 f7 V; f5 B4 A! A- A' Z     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
. ~2 |! m5 S2 |: y# o    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
: j( s, M( ~% a( j    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 \4 t5 y, J+ a% |4 B( y0 Q    Call PrintCookiesInfo(divSet(4)) # R& g9 v8 i, G0 l- C2 |% L1 G4 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))
1 V, a9 V' h7 O    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
% m# ~2 z9 S* A& e" d( ?  k    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
8 Y9 [5 d* D; L* H0 q& h3 c/ H) [    Call PrintDatabaseInfo(divSet(8))
  A+ N4 `4 L' ~4 W* l    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 8 t# `$ ~; o# s- }
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
( ]# w9 S" {4 T8 C3 Q. b) u) [! {0 U    Response.Write "&lt;/Table&gt;" & Z8 B8 o1 L2 y5 J
   End If 7 d: t0 k1 }( W: j, \
End Sub </P><>'Destructor 0 t1 v& _# s, ~, S3 {
Private Sub Class_Terminate() - H$ B* x5 m- b9 g5 L) u
   Set dbg_Data = Nothing $ P( r1 u, ~( b; ~0 }) T
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>1 U* _& X5 u" o8 x$ s& a# O# r
CLASS debuggingConsole
# \" S. @: V4 _- hVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
6 s% j4 A$ B. q5 C&amp;n, A. a9 o, {& I! a) {' m; y
bsp; 3 t5 k: `3 C& H. M, e
Property Get Enabled===[bool] Gets the "enabled" value
# n0 s  x4 P% k( O( a. y( _4 m1 ]9 g  # q" L  V, F  A* G4 j
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 ; _( B1 _& }, r5 Z  l9 c2 W
  % [9 ?) x- B' U$ `: o/ j$ M
Property Get Show===[string] Gets the debugging panel. / e* B8 n2 @- R9 T% k% x
  7 S9 @/ B" N" v
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><>--------------------------------------------------------------------------------
9 Q  |# u0 \" F1 X- b7 vPublic Methods </P><>public sub===Print (label, output) 2 p) l( F% \, N5 @3 m7 B
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) - c6 k/ R: E: v, ~- p3 I! q& Y
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
" u5 v9 ^5 R6 a) t+ L   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 3 v3 V: M4 ^, \4 d
Methods Detail
) f8 e: y' [/ {; T0 t+ r  4 E) T2 h5 `' L: [. c
public sub===Print (label, output) 7 ~8 l- G* x0 V& d. V  l' K
Parameters:  1 w) S2 i% M0 D) \3 I+ D4 l: ]
   - label [string]: Description of the variable
) X  {) h6 J7 U7 }9 B   - output [variable]: The variable itself
# i( I9 o$ H# _$ F1 O, u  9 J% I4 [# s( }! o, q  D/ {
public sub===GrabDatabaseInfo (byval oSQLDB)
, ?9 ]+ @( f, a! C( W% m9 g4 {Parameters:  + v6 }  C) b2 U- W- D
   - 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-13 13:55 , Processed in 0.437570 second(s), 57 queries .

回顶部