QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>" F  d# b# g2 r) {( \' M
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! + ~& ^: t4 {" h1 r) V
使用方法很简单:
) y: `- j6 ^! K. Q: J8 k0 {( W( J' Xtest.asp </P>8 l1 x$ n: J8 ]# w1 E
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
1 U7 P6 q) f6 _" W&lt;%
; v+ b' u- w. T6 z. u" moutput="XXXX" # a+ ?1 I8 j1 O. f  E
Set debugstr = New debuggingConsole
: @3 w( }3 h; j' }1 Jdebugstr.Enabled = true
+ A' ]6 f, ~1 V$ p   debugstr.Print "参数output的值", output " y/ c& s1 o" ?5 s! c
   '…… % v9 [4 ~  V" C5 d0 q+ Q8 @# Y
   debugstr.draw 6 \) \/ k* J9 M
Set debugstr = Nothing 7 J- P/ v, E% w- Y1 F+ }- P2 p) c
%&gt; </P>0 W% X* X$ a& ]' O; y3 m
<>=================================================== </P>
6 Y* ~% M& c4 m$ S( _% f<>debuggingConsole.asp </P>' d1 K, \( ?  d$ \$ j- W, a
<>&lt;% * r" f, I$ ^. [; ?; Z
Class debuggingConsole </P>: f7 s; ^& I. V1 `
<>   private dbg_Enabled 7 k+ b9 X) k2 X" \  l* o6 ]5 B
   private dbg_Show / Z+ _( Z8 S5 B9 @) h9 S" R  x$ n) E3 J
   private dbg_RequestTime $ z; ?4 k% J" C. C+ O
   private dbg_FinishTime
# M/ L! U$ `1 Y/ V3 i  t* I   private dbg_Data 5 \2 v; b7 k2 K1 J- ?0 b% H( j8 Z
   private dbg_DB_Data
, r4 B& h1 s$ s+ z' N5 ^. K# D   private dbg_AllVars
, @: t8 L  z3 ^" G; W. B% P   private dbg_Show_default
9 U3 a9 F# ^/ F  d   private DivSets(2) : H- I3 H! S4 J- J
   $ U; f9 i. E. `  s# v
'Construktor =&gt; set the default values ; W8 Y8 D3 D8 O  [2 V) G
Private Sub Class_Initialize()
! O2 w) y: `: b* L9 W5 _" j   dbg_RequestTime = Now()
, q0 j/ o+ A% _& f! c   dbg_AllVars = false
! C6 l6 G* s1 z7 y- ^5 i   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
; y3 g8 @$ b/ F/ I& k( \8 I<>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>+ z- ?/ i4 C& \7 }
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;; {' L9 G1 o0 a4 V% n4 b" p
&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>. I* x' m, ~6 D$ n: V% 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>  w3 b- m% y* N0 H# J. o. j8 C4 a
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"   W2 _. U% n& L4 Y) B
End Sub </P>
) @2 J" j, [, L, S<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false # M# t# S1 e7 g; S' c# Q( t
   dbg_Enabled = bNewValue
; _$ p$ x7 Y: \2 n3 h/ HEnd Property </P>
' p" _( \7 \8 S2 {$ r5 S/ y& l<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
8 J9 F- x; W, b8 G! q   Enabled = dbg_Enabled
' f* d. K7 D, D* ~/ SEnd Property </P>
. e8 |8 Z8 r8 \' \9 @5 k# g3 T<>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 8 y! M/ J/ i7 R& M* Q
   dbg_Show = bNewValue
) [. B' }/ S2 L4 V* X8 ^End Property </P>9 s: @5 v/ l- [5 B5 q3 V+ |
<>ublic Property Get Show ''[string] Gets the debugging panel. . I6 Y3 J* z, N( w; _) s
   Show = dbg_Show
( J7 c3 d0 [' p8 h" l5 [. \End Property </P>
2 m$ h9 a; `& R5 X& q, Q' b<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
3 x# w5 X6 @' M" \" o8 L/ n4 ~   dbg_AllVars = bNewValue
3 s$ s% k' E7 ^! z+ [/ z4 j. WEnd Property </P>8 `% h. H) t- {& }* E) ~7 a  m
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. # K1 j+ u; @# L4 V- o! B9 H2 J7 Y
   AllVars = dbg_AllVars 4 q8 d. K0 s, a0 J# ~5 _, }
End Property </P>* w2 O7 W9 f: }1 L* k
<>'***********************************************************
- D3 i( Z6 R  V''@SDESCRIPTION: Adds a variable to the debug-informations. 7 _; N; G8 W& J) Q( \/ I
''@PARAM:  - label [string]: Description of the variable & A) G3 ~4 }+ j6 f* L: U
''@PARAM:  - output [variable]: The variable itself / f0 W: h2 C$ }$ h* w
'***********************************************************
5 y' [6 A/ {2 ~4 e1 A( P9 c4 Z5 YPublic Sub Print(label, output) % a% {$ j! Y8 ~# _/ w
   If dbg_Enabled Then , F; c7 O) s' b  x% k% J
     if err.number &gt; 0 then
4 S( O6 J# j1 Y       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
' Q* N0 M% B1 |       err.Clear : c; B6 }$ i5 t' x
     else
2 Z8 s# q" G7 U- d+ e       uniqueID = ValidLabel(label) 2 l$ [9 U  T) A" k5 i/ N8 m- U& _
       response.write uniqueID # S& ^4 {8 }; u2 J2 Z5 t
       call dbg_Data.Add(uniqueID, output) $ p! A% b; V$ ]% g
     end if 4 Y! v" K: \& L  Y
   End If / L( W3 g: X, u# p6 s2 c: ]2 N' r
End Sub
& }6 z, C* s8 z2 l8 v  % _; D: |( K6 V0 Q' K# v! [
'*********************************************************** . q& J3 |9 u' z* a) D/ D) }" P
'* ValidLabel 6 E# I$ K9 S5 j) O2 ?3 I8 B
'***********************************************************
. o! U# ~) H' ]Private Function ValidLabel(byval label) ) V# x# V+ C- f3 L
   dim i, lbl
# q( r4 o1 h0 J/ \+ [, q" G   i = 0
7 Y" z$ N/ M& n5 T9 s* d   lbl = label
7 W" w$ ~6 g6 ?4 @2 W6 Y   do
( x6 _* d" `# k   if not dbg_Data.Exists(lbl) then exit do
7 B( w/ C* p0 Q+ N   i = i + 1 9 c* B" Y# ?, V# w: g) K
   lbl = label &amp; "(" &amp; i &amp; ")"
* s: X: ?" `. H# Y  G   loop until i = i
9 C6 D' E  q# U3 i5 u  
1 [( H2 g& r8 ]" q   ValidLabel = lbl
4 s/ q6 e5 X5 DEnd Function 7 Q$ F! p8 j! y
  
* [  t% _! ^. q1 K/ {'***********************************************************
, N( \! H6 K  f! N6 h  X  D'* PrintCookiesInfo
% n7 c$ p  P' ^$ O$ ]'*********************************************************** 1 q/ C1 Q6 T9 ~, g  w7 e$ F$ g9 l1 c* T
Private Sub PrintCookiesInfo(byval DivSetNo)
- c3 m. E; D) z* L. o- `- u   dim tbl, cookie, key, tmp
( G! V* v( q2 X2 Y6 h7 h   For Each cookie in Request.Cookies " ^: u: _* J; Q& K- T" s9 _
   If Not Request.Cookies(cookie).HasKeys Then 8 K0 s' D2 g, h$ ?7 f  ?# e, w7 {
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
( I! b( c. B  W/ n! C   Else
% ~3 P( I; E2 N0 p1 g' L     For Each key in Request.Cookies(cookie) & h, \+ K: a- C) X* f
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 5 s- d. X/ z9 O; Z8 s1 }6 F8 t
Cookies(cookie)(key))   
, P+ S' j- h( u5 J9 k/ \( d! [   Next * I* a4 `4 ~; R/ V3 v8 v% c
   End If 9 K1 B$ i, a& Z% m# L" y1 I$ P
   Next </P># |' y" M% |8 J/ M$ }" Z9 ^; E
<>   tbl = MakeTable(tbl) ' b9 [' W0 q. h& G
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 : p4 M4 S% q/ }
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) * D. p( F! f# N0 [6 F1 n9 y. z* r
   Response.Write replace(tmp,"|", vbcrlf)
/ U5 h) u. H- s( I  x/ j' ?end sub
8 C- c; x/ W: }. M/ m9 R8 r  
1 K1 \3 u) Z0 \" g. O8 Q9 }'*********************************************************** 2 y2 {/ G: }- k8 f) L8 v) _" W" b
'* PrintSummaryInfo
6 B/ B( T7 F& C( S* G/ X* u'***********************************************************
, q& G' d/ I! MPrivate Sub PrintSummaryInfo(byval DivSetNo)
2 T& z$ g( w0 ~. u6 D% p   dim tmp, tbl 2 }7 l$ f9 ^0 W8 q- }- k
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
3 P% e! J' C% S" B   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
; t" l+ S0 Q  W2 n, V7 v7 @   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) & c2 r. g9 \! R# y9 A* G9 ~
   tbl = AddRow(tbl, "Status Code",Response.Status)
+ C9 o& u! p; F   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) / H" s0 t, _' t# `5 a
   tbl = MakeTable(tbl) 8 l0 f" h( N1 l, F+ o
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
8 \/ Y# q/ q+ [; t& m$ M% o. ?   Response.Write replace(tmp,"|", vbcrlf)
) E, k* y6 G$ P# I" wEnd Sub </P>: O+ Q9 F( `5 x4 w3 _0 t. W1 [
<>'*********************************************************** + \5 A' E: Z# E6 J5 P/ x5 [6 b
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 4 Z- U; c% z  e
''@PARAM:  - oSQLDB [object]: connection-object
" m& @) c' A0 W! t, ~'***********************************************************
! Z) @) t# u0 i1 GPublic Sub GrabDatabaseInfo(byval oSQLDB) # e, \! o( w4 E& y
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) " A  I8 Q( M. `& i6 V
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
8 Q6 T7 r# q6 D: I) i5 }# Y- X   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")) ! w! f  D# E$ c, E2 q/ E; K
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 7 `2 v9 U& c  g* u  y! v+ ]
End Sub <>'***********************************************************
& P8 t* R$ c! b0 y6 c6 B$ T'* PrintDatabaseInfo
! `8 p1 ^# o; \7 S* Z'***********************************************************   q0 p4 t: g2 P
Private Sub PrintDatabaseInfo(byval DivSetNo)
' o6 ~2 M# x2 ?! i7 N3 p6 f6 l# G   dim tbl
) z! i. K% R" L1 c9 d% L1 P  H   tbl = MakeTable(dbg_DB_Data) , |: Z" r, @6 [! R( n8 [2 D: s
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
8 y) m2 M/ @" r6 J5 D   Response.Write replace(tbl,"|", vbcrlf)
4 ]7 v# z1 Y. p- S' d; fEnd Sub </P><>'*********************************************************** : X3 L6 z0 {7 w3 l3 ?
'* PrintCollection
% q0 t% y" B/ g5 E4 c1 {6 b'*********************************************************** 3 H& [, G2 S3 i# N8 V
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
' \% ]+ [/ `: s; O; \$ ^# ~1 b   Dim vItem, tbl, Temp 7 U% Q0 w  I& p" D& r* p$ O
   For Each vItem In Collection
/ J8 q% B" i5 ?- {% `     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
/ Q/ R2 Q" W& _" y, e) J       tbl = AddRow(tbl, vItem, "{object}")
) B8 P) g$ @6 I0 l1 k     elseif isnull(Collection(vItem)) then
1 T. T% R; A% t) o6 [7 j# U0 z( T2 U       tbl = AddRow(tbl, vItem, "{null}")
3 n  R8 _2 Z9 U7 V: T5 J' m' G     elseif isarray(Collection(vItem)) then
* t: C( P3 |" Y5 P; X       tbl = AddRow(tbl, vItem, "{array}") " [! j; i# Y& \$ `, G! ]) G
     else 8 q3 l4 m( u# P3 ]2 L' ^
       if dbg_AllVars then
; b$ K) e5 Q2 {5 U% ]       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
5 f1 O) W: |0 m" D     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then " E4 M  @5 z8 l# x& u; B
       if Collection(vItem) &lt;&gt; "" then   v& D0 R3 p, w0 i7 @# I* e
       tbl = AddRow(tbl, vItem, server.HTML6 @# M6 G0 h& j+ h0 W0 R$ i
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") * S' V; a/ M1 b; b9 }6 G+ X8 L% v
       else ; f* p, F7 V& Y+ B8 {4 W4 t* n3 S
       tbl = AddRow(tbl, vItem, "...") # K0 `8 J( ?$ c8 @  }1 n
       end if 0 p- P( a' H. t# o
     end if
5 g% j' E# R) L  `   end if
7 d; x: l" n. ]3 ], X7 @; K   Next
! G+ B" b. Y% x8 c, J   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo 9 r$ n% W) [4 F0 V, x8 N
   tbl = MakeTable(tbl)
! k; k+ b, d% U   if Collection.count &lt;= 0 then DivSetNo =2
7 b; e- v* p" b7 d+ e     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) : v- N- F" Y5 K$ C7 Z
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
' h6 N0 e; B( @' X6 x1 ?     Response.Write replace(tbl,"|", vbcrlf)
! f* ^; S4 F; d6 Z9 _2 OEnd Sub
0 `+ w( Y4 A( W1 K. ~# T  
/ |+ G+ V) H6 ~6 Z7 Q5 {1 N" w'***********************************************************
" R2 Z9 M6 E% g  B; c'* AddRow
0 u5 Y5 Z: T. e8 b. Y) v'*********************************************************** : X) ^& w: r( J& h$ G; ?8 U! I; L
Private Function AddRow(byval t, byval var, byval val)
  B) C! l1 b8 W5 }4 C   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
( q) g* ~$ W' ~) t" y   AddRow = t
  o4 T9 r$ G- y- EEnd Function </P><>'*********************************************************** % Z* k( |' N: w8 C" b8 c) n" ~/ }& o
'* MakeTable % i, ~  ]+ J* k* j1 u1 ~9 [* A
'*********************************************************** # g3 k) O, E0 F1 T, s% q" M( u
Private Function MakeTable(byval tdata)
) \/ w* D2 L  G7 o+ W6 M   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" % _5 R0 a3 C7 u% H
   MakeTable = tdata - z- l" F3 x7 d- Q$ B2 c( \
End Function </P><>'***********************************************************
' q7 j4 G4 P0 _2 f0 j4 x6 O" `8 g''@SDESCRIPTION: Draws the Debug-panel
& o' `/ ]3 h7 U9 }# {0 ]: b9 S' J'*********************************************************** / E9 L/ z& q% H% C% D" I9 {
Public Sub draw() 6 ]( l' _/ J+ i: l( h) F
   If dbg_Enabled Then " x8 g" I3 ], X
     dbg_FinishTime = Now() / {1 F+ h( y8 n
  
$ k* o% ^5 U* c   Dim DivSet, x
4 _( a8 ?) a5 _# s   DivSet = split(dbg_Show_default,",") / K& O2 V1 L7 \  `1 h3 F
     dbg_Show = split(dbg_Show,",")
! _! x0 I) d: W- n2 c% u" S  ' G, Y( D; i/ y: p
   For x = 0 to ubound(dbg_Show) 1 w5 b0 u9 D+ x
     divSet(x) = dbg_Show(x)
. ~3 u. T7 N; q' U% u! t) D& |5 @   Next
! @7 Y% x* R. j; w/ e! [9 H6 s  
2 F; l8 _& k9 o9 ]9 J   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;" $ o' Z3 Z0 E0 \  s5 c6 s$ w1 V
   Call PrintSummaryInfo(divSet(0))
5 ?6 O! }; V) t* `2 m5 R2 q     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
4 n7 H4 j4 r8 q    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
3 e, M( \; I) M% [: Y. ~; B    Call PrintCollection("FORM", Request.Form(),divSet(3),"") % S! R/ K9 Q4 C  L+ H+ D7 o1 I+ p
    Call PrintCookiesInfo(divSet(4))
1 k1 f9 U) a  l0 B" O9 c    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 ]/ z9 `+ z4 c- K0 Q7 t# O
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
: f5 Z. K* O2 F0 |0 k' y5 G    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
& p# s5 o# v% M! y  I    Call PrintDatabaseInfo(divSet(8)) 4 O5 ^2 N5 J3 _- Q0 F1 B. y
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 4 C/ n8 m+ X* r
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
" v, R/ ]0 E) B* V0 \    Response.Write "&lt;/Table&gt;"
- r; i/ L/ R  P$ A5 o1 _/ L: G7 ?   End If * \& w3 V9 n* G. b0 N
End Sub </P><>'Destructor 9 V9 s! S  K- k9 g$ O
Private Sub Class_Terminate() - I* z/ E/ g# ~2 Q% \8 y
   Set dbg_Data = Nothing 4 c, B. I2 J+ u# e- C
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>( |! z( A: |# b) F. B- X4 Q
CLASS debuggingConsole
% n7 v+ N0 e* {& j* z; D# ~. DVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
5 b' T- j. O  }4 v5 k3 X&amp;n- F6 Z- M: e5 t' W# A# Q
bsp; 8 r# W8 O/ c/ T5 \  ]( w- @) n
Property Get Enabled===[bool] Gets the "enabled" value
7 P, }, {5 a5 l: M  
6 y; K8 W5 o1 M( nProperty 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 9 s/ V1 M9 ~; E$ K: T
  7 D. `  V3 w7 R( z9 }/ d: J0 `2 \
Property Get Show===[string] Gets the debugging panel. 0 o) @+ Q! f1 Y. ~8 @7 \) X; y
  
0 u) ]9 `5 ~% G7 kProperty 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><>-------------------------------------------------------------------------------- : S8 J1 X/ a( `7 N* B
Public Methods </P><>public sub===Print (label, output)
$ d' i7 t" k( E+ Z   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
; A7 }- m8 W! y7 a* o* d   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 7 N/ k. J6 G+ \, s9 p9 p0 y# i
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- " g& `# n- |4 q+ N2 x3 i* i
Methods Detail
9 h% M9 ~3 q( R, i2 V7 j  $ S' Y. ]; q: @5 M- c+ D* |7 L
public sub===Print (label, output) 3 i( r  N, w3 Q2 Q2 C  S% Q
Parameters:  - \, [/ l: o+ p8 f& g
   - label [string]: Description of the variable
; E+ V' N- w5 ~& K& c   - output [variable]: The variable itself
) t5 O  A; n! [4 y    {7 a3 {  L6 \
public sub===GrabDatabaseInfo (byval oSQLDB)
* }* [) X0 Z+ V5 ?, P+ N8 [Parameters:  
* g' Z) ^* ^% @- ?   - 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, 2024-4-23 15:02 , Processed in 0.284535 second(s), 56 queries .

回顶部