QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
  r, ]" B& |. w# Q<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! " ^! L& R! ~3 t5 \) z
使用方法很简单: $ q9 _, W& _) C% h; i: W- O/ H5 |
test.asp </P>
9 Z0 x4 x- n) |. T$ r! f<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
0 T: l1 {! r+ |& {' L# `&lt;%
6 }( v+ Y3 Y; M9 Aoutput="XXXX"
; z5 C+ y6 ?& y$ T/ @Set debugstr = New debuggingConsole : D" Y2 G. k; Z+ c- g
debugstr.Enabled = true 1 a' g9 `  d. r8 _/ L4 \
   debugstr.Print "参数output的值", output
; y' P5 ]6 l, u7 [5 K+ q   '…… 4 S  N, @, U2 I1 u" _  h, V
   debugstr.draw
3 ^# Y! f! S& g9 h& XSet debugstr = Nothing 2 D, o2 Z5 C% y1 @) Q0 v1 n
%&gt; </P>; O) Z+ k6 r% I4 s  {4 q
<>=================================================== </P>' h- [* |& i+ `4 p9 k7 d
<>debuggingConsole.asp </P>
# O) t& c: I# w<>&lt;% - e6 M: ~9 r: D& V8 x) N1 N+ K
Class debuggingConsole </P>
5 l! n  B) b6 J/ j$ X<>   private dbg_Enabled 4 y* Z1 s' D  X7 a) J
   private dbg_Show 1 t% A# d* ~+ Z3 M. D% x
   private dbg_RequestTime 8 f( W  Q+ k: w6 Q3 E, @- I
   private dbg_FinishTime
9 a' C2 P9 u) k) a   private dbg_Data
  |% R  f5 ?1 O, `+ v; u) F   private dbg_DB_Data
, N! W; m0 z; J4 n* v1 G" z* V- E3 w; W   private dbg_AllVars
' L# z6 x9 ]/ p& j   private dbg_Show_default % d5 \+ _2 k( L0 N
   private DivSets(2) 1 D, {( t9 b+ m, p1 C9 I: h9 G
   
5 y; F, f. a' G5 h7 t/ v'Construktor =&gt; set the default values 0 [+ M; J3 s/ L- t, X9 D, F& N
Private Sub Class_Initialize()
9 N! U* K0 [2 o: A, A! d   dbg_RequestTime = Now() 9 s3 R' Z( R" ]6 Y7 S7 A2 c
   dbg_AllVars = false ' O" p: k& ^5 m
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>. ~$ M" \$ B3 Z1 q
<>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>
1 m9 F) ~* [3 E9 `6 X8 O<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
& \5 Z( n- @9 ]2 c7 Y* f6 q  D- a/ v&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& ?; |0 C- P  b2 p<>   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>
* W/ T/ M8 B  u& u! ^* V<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
5 r/ V' t1 g  S1 \) V. f2 BEnd Sub </P>
( N6 ?( X5 s' I9 A# c* R- ~<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false 4 q! _) j% E  \* W' G
   dbg_Enabled = bNewValue
0 Y) j+ w$ y) P6 N; j- J6 l% CEnd Property </P>; v- M8 I" X, R& B
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value ) ^% b. d2 p; I/ q2 _8 M% W
   Enabled = dbg_Enabled
6 z' }% b$ g! ?9 J8 d6 d& |End Property </P>
/ P. ^, K. a$ ~* {1 u9 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
1 Y4 j6 w6 k+ M- p   dbg_Show = bNewValue
# |1 }: h' m: B& Y+ A, q( MEnd Property </P>/ b' b6 l' s; Z5 \6 N) F# a' Q  Z
<>ublic Property Get Show ''[string] Gets the debugging panel. ' g3 G1 y0 |+ m# V6 A2 E* n
   Show = dbg_Show
8 G7 d' Q, }! O/ D+ ^. PEnd Property </P>
+ H: f9 O$ W. z4 C5 s/ l5 |<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
; G/ m9 a! p4 c4 Y  F+ u3 m' }  l   dbg_AllVars = bNewValue % j# _0 Q" Z) j3 u+ d5 i' Z8 v9 Q
End Property </P>; N2 P( Q- l8 x4 v. E
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 5 _; V0 G& F3 k5 R8 b: I
   AllVars = dbg_AllVars + ?9 \2 q6 D5 o5 Q( y& b# G8 A0 _
End Property </P>" g: R8 D/ t8 z6 g+ t& B- n! ]
<>'***********************************************************
8 y8 H9 ?( t7 U: H( }% F* ~7 J''@SDESCRIPTION: Adds a variable to the debug-informations. 3 |2 N9 E' }' N: W7 Z, g% [
''@PARAM:  - label [string]: Description of the variable
+ H: w4 T  D  N3 P& P" R''@PARAM:  - output [variable]: The variable itself $ b% b* k/ X2 y2 ^2 w
'***********************************************************
5 b/ d+ G; r2 |5 D  v% Y2 bPublic Sub Print(label, output)
" ~/ F% {0 W+ c6 }* K* O   If dbg_Enabled Then # s1 l' N/ j  f  a
     if err.number &gt; 0 then % f; `4 H1 I! U$ @6 V( Q
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
* B0 B* E7 R$ }& K+ Y( C       err.Clear
+ |1 }" `* R% _/ }8 v2 g4 V" S     else
" l$ M! r, d4 P) W/ J       uniqueID = ValidLabel(label) + {4 X/ F2 y, I) D9 i; I+ D
       response.write uniqueID " X8 ^* R8 E% z  F- Z" j9 V/ z% a1 w
       call dbg_Data.Add(uniqueID, output) 4 ~8 {' D" y# \' u  y/ R
     end if - J  @) a+ z; u& E4 E9 Z
   End If ; w$ q% a/ q3 K: S8 l3 \' q' h" A
End Sub
6 i: b& ~# e( f) N% `  ; b, n  w* f: v, P6 a3 J2 q
'***********************************************************
) }1 }2 Q+ i8 d  c" K6 u$ I'* ValidLabel
* p1 O  ?+ ]& ?/ V'*********************************************************** $ l% V! e7 D  K! t. }4 `+ {( X/ ^  ?
Private Function ValidLabel(byval label) 5 i+ V$ k) z! D3 ~
   dim i, lbl ) w9 w4 w7 |. s5 W7 Z
   i = 0
- z' P8 c" l' x) w8 L  a2 r& a4 Z   lbl = label " ~( c% ^1 p1 b$ A% c6 @
   do & g- l" ]# M+ ^; U
   if not dbg_Data.Exists(lbl) then exit do
7 q8 R7 K3 f8 {7 p' j   i = i + 1 2 r# i; s4 Z4 Z! ?6 b; j3 \: `
   lbl = label &amp; "(" &amp; i &amp; ")" ' n( [; X5 j1 ^) l6 e
   loop until i = i
0 ^: J+ w6 I* u: A  * e) w* G0 v/ d8 ]
   ValidLabel = lbl
  V# F* U$ n$ x! f- L7 z& W$ a  TEnd Function 9 S. `2 ]9 \/ s9 [
  ) w) f/ _! f0 N; I4 g  ^6 Q! @& Q
'*********************************************************** $ G. W; l5 ~  u. ?$ @; r( _
'* PrintCookiesInfo
, R$ G! e: x0 F' G' i3 P, Q" h0 H'*********************************************************** ; \1 Y; g$ G/ W1 k$ f
Private Sub PrintCookiesInfo(byval DivSetNo) & w) A7 y$ ?3 _& A) ^8 u1 \1 S+ A
   dim tbl, cookie, key, tmp
, j6 e  m, i& s; p* f6 x   For Each cookie in Request.Cookies & ]5 v2 w% h: j( ]' A8 v
   If Not Request.Cookies(cookie).HasKeys Then 3 H( Y. Q* Q& W1 f% N0 r1 l
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
3 d* Y- e5 H# I+ c# q   Else ! n2 z7 H) q7 N3 X7 ~1 G3 F
     For Each key in Request.Cookies(cookie) 9 \8 V' l+ x1 W% R$ H. u0 }
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
# L7 H6 a- m+ ^1 [Cookies(cookie)(key))   7 B+ w% [5 U+ w. Q% k: F" g
   Next & d$ a& D. Y' s* K) r- D
   End If % z$ Q6 P9 W# d. U2 h) i
   Next </P>$ Q( o0 r- O6 J& t
<>   tbl = MakeTable(tbl)
; X: j+ _$ M9 w  }$ ~% G0 Y   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 ; x( |7 o1 K) {. _" A. s/ V
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) . z8 E' g  I. \
   Response.Write replace(tmp,"|", vbcrlf)
6 ], a& ~# z4 p4 e& @1 f# G1 m1 Oend sub & j+ K, P2 m- `5 C
  
8 V% w3 I" l4 o  W, X'***********************************************************
0 ]  ?1 h0 o4 ~: F8 g9 {'* PrintSummaryInfo
% Y* T* L6 Z& u% E4 u2 i8 b'***********************************************************
  [0 ~0 I& f% Y8 E! [  \) YPrivate Sub PrintSummaryInfo(byval DivSetNo) 9 g4 [% a* E' z" E! G  ^
   dim tmp, tbl ) v8 J1 p; ~& u/ P3 _5 O
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
  Y* f% N3 Z9 w   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") / U3 ^2 a- O; W8 `7 {
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
7 M: R" [3 g7 ]8 B8 H  ]   tbl = AddRow(tbl, "Status Code",Response.Status)   X9 `8 @5 a+ q# S3 m- a2 z
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
4 M6 U/ A) G: v: X' _5 Z0 x+ i   tbl = MakeTable(tbl)
# F7 P$ z7 J8 V" G/ X5 K* S   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
8 e" f7 d; I& O. g/ t  n2 R2 w   Response.Write replace(tmp,"|", vbcrlf) # y3 c6 a( Q4 `7 x  |
End Sub </P>
' t" g" m- Z' ~" D3 U$ i' X<>'*********************************************************** 7 ~1 T4 i% Q" g( W3 L  K; f3 `$ U
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information $ f( p) D& {# d) w. s/ |
''@PARAM:  - oSQLDB [object]: connection-object
- c5 f$ B  |& I& g" V'***********************************************************
$ M) `7 Q" o& ]Public Sub GrabDatabaseInfo(byval oSQLDB) $ a8 X# ~8 F% O! f) @
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
0 A6 i) `6 ]# W; q! x4 B   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
% p; \4 a( h" |% M/ o- k   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"))
# @; e' p% @6 R7 j5 z% S% h   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
. n3 _* g/ s4 b+ ~: M4 j7 vEnd Sub <>'***********************************************************
; T7 ]9 l: p& x$ Y'* PrintDatabaseInfo
: ?* L4 u* A+ }* Q'*********************************************************** 3 \% M: N. O3 C# c; f
Private Sub PrintDatabaseInfo(byval DivSetNo)
+ Q. y1 w: [6 @) E1 r- `# `- q   dim tbl 3 W$ g8 H" {9 L% m
   tbl = MakeTable(dbg_DB_Data) 8 G/ E# D3 ^  U) B/ @' v& J' a
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 3 E# ?$ B( V2 P1 q
   Response.Write replace(tbl,"|", vbcrlf)
" r* w8 ~( t+ C, _4 _* k6 {. CEnd Sub </P><>'*********************************************************** 0 y+ Z3 _9 u- E* j5 k3 i
'* PrintCollection $ U: n, k0 h3 @8 {1 j6 P
'***********************************************************
+ q. G( A; b4 K, R' e1 f1 p: ?Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
/ i: p5 ]# z/ U   Dim vItem, tbl, Temp
* H& M, p5 P8 c   For Each vItem In Collection * W+ v0 R5 r/ j% i) j2 ]0 Z+ U
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
+ {6 ~7 @- x# N8 i       tbl = AddRow(tbl, vItem, "{object}")
* w, M6 R* w. p3 L! g2 V     elseif isnull(Collection(vItem)) then ) h! I" L9 u/ S5 d
       tbl = AddRow(tbl, vItem, "{null}")
) b" u+ _0 _/ v4 _+ F% }5 F+ j     elseif isarray(Collection(vItem)) then
$ e7 I5 b! @9 T4 o& q* b* g       tbl = AddRow(tbl, vItem, "{array}")
# z' G! o. E, t$ y9 P' H     else
& G, i6 t0 {& V$ }       if dbg_AllVars then
# Z' L* k) Q, H6 P1 c, u& k       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 7 w0 d% ~: O$ A1 i, V- u: L
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 6 g, ^% H/ ^% l- ]) O5 G
       if Collection(vItem) &lt;&gt; "" then ! p( P9 v3 u) o( c
       tbl = AddRow(tbl, vItem, server.HTML
% C- [( n5 ^7 d( A2 T. v1 ^Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") , R( h* h4 U& P+ e, h0 }) {% e4 i
       else % Z( s2 z6 A1 @$ q# c
       tbl = AddRow(tbl, vItem, "...") % r$ c* T+ T+ z
       end if 3 S5 \6 m+ ^4 J  {
     end if
1 r/ y- y7 [" o0 J; M# f  l& @   end if
" E7 P5 A! v5 u) B8 n3 Z   Next
" t  \7 N  s6 Y" a6 T) B. \   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
% I  p1 P  H2 k1 t) I0 w   tbl = MakeTable(tbl) $ K/ A+ J$ _8 R, L. m
   if Collection.count &lt;= 0 then DivSetNo =2 0 H2 V( s$ g7 N  w/ c9 u% I( h( ?
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) + O- u. h8 e: |& a$ i5 o) x7 H
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) % j5 e! ]4 ^0 z, h5 }; o
     Response.Write replace(tbl,"|", vbcrlf)
8 ]" H8 {0 m, h7 x: ?+ l- v% F2 ^End Sub 6 g1 m2 ^0 D0 e; a
  6 [* u, ?+ Z% W- W! [' ~: h
'*********************************************************** % A2 s/ K+ _* d; b
'* AddRow
  }8 U- ?5 ~# \% x; t& |7 k'***********************************************************
( F; l! i1 O/ `" `Private Function AddRow(byval t, byval var, byval val) - S. `. ~3 y8 i" y
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
+ F7 ~# D0 i! G3 N' R" Y' {, D" d! S   AddRow = t 8 z) k% X' e: l# I7 [% r
End Function </P><>'***********************************************************
/ d9 m7 [0 Q$ t5 ?" {7 I6 L. ?1 n) o'* MakeTable 3 b" c# m8 F% g& s# k& z4 _# @
'*********************************************************** * f# b! {+ H6 S$ e
Private Function MakeTable(byval tdata) 9 r) M( |0 ]8 H6 R1 I
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" + G: Y& \) c$ h7 {3 m
   MakeTable = tdata 5 j8 q' b  {$ s3 |5 ?
End Function </P><>'*********************************************************** 9 V/ t' d/ B$ `# h
''@SDESCRIPTION: Draws the Debug-panel
6 ^; p. c( C; d4 ?: P. N/ m- S'***********************************************************
5 H7 t$ @& c. h& B& N. XPublic Sub draw() ! R; u. N/ J  [4 I5 \
   If dbg_Enabled Then - u1 u/ f: A( m7 E: v' q/ H* I
     dbg_FinishTime = Now()
1 Y  `" G* `7 r7 m  * A- L6 M& n9 h' `7 C# j! s/ A/ z3 x6 X
   Dim DivSet, x   }* \0 h' U+ m& e* t! O3 P* [  r# E
   DivSet = split(dbg_Show_default,",") 4 S0 b" k0 ^0 e# e( f- H
     dbg_Show = split(dbg_Show,",") . `5 a/ C5 q2 z6 {  n
  % }) N6 S8 P* v9 O) V
   For x = 0 to ubound(dbg_Show)
+ L% |/ o  \4 _) D! i0 d     divSet(x) = dbg_Show(x) , _; ~9 J1 z, K
   Next ! `, M* o, l! V" K# u
  
* e0 Q  U/ @/ a% {/ r% t  a/ f   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;" , Q" ^& F8 T$ [# H
   Call PrintSummaryInfo(divSet(0))
% A$ k& l1 _, W4 j7 k, f     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ! }% S' I, c# d- {- x! p
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ) }+ A: A, w) x" B( r  u
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") 3 R* n, X/ A! V( R
    Call PrintCookiesInfo(divSet(4)) 1 U6 w% y2 x- `7 A
    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 Q0 J3 [7 }; u4 y    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
8 S: t% m9 p& ~# ?& @    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
: ]7 g* i7 z% U; v% U+ Z    Call PrintDatabaseInfo(divSet(8))
- A; _" L8 T- I. F    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
# o! N' v9 z' `: d" Y- W" ^    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")   f, k1 [0 R+ [- l
    Response.Write "&lt;/Table&gt;"
2 F- C- w! b1 L# A1 T0 d+ r4 Q0 b# u4 c5 V   End If
7 e, C, k6 ^  V! _+ HEnd Sub </P><>'Destructor
/ E$ z% T* v* k+ ]Private Sub Class_Terminate()
7 k* O6 z9 W" B' w: t   Set dbg_Data = Nothing
5 `+ ?' o0 b: I% K4 P6 M5 I5 @+ MEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
7 q8 z5 {( z: [1 jCLASS debuggingConsole
! m& ~1 c+ {$ H3 `- D% E1 `4 BVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 7 v. f% D1 @: E9 h. m) u
&amp;n6 n0 ^: Z) {7 v3 F! W1 i2 }$ A
bsp;
/ T! g9 Q8 n2 p6 K, RProperty Get Enabled===[bool] Gets the "enabled" value
. T* y/ Y2 Y- W: O5 {  
: D( x* P. q1 ]9 VProperty 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
& p7 D! `$ D4 V- \- n" g) I  
! [" y% M" f! b+ Q' ^/ Q& y8 qProperty Get Show===[string] Gets the debugging panel. # o- O$ J' D2 g
  * N. d+ J8 ]0 e
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><>--------------------------------------------------------------------------------
5 X+ w9 M% u3 b) k5 f+ mPublic Methods </P><>public sub===Print (label, output)
( u9 W, \: E7 k9 E! i( S) [. V   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) : A( a# D0 j5 w' d; a
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () / }  i' w6 q+ G" o9 ^* l
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
+ n2 `! r- ?: i( p; i5 e5 UMethods Detail + }" `4 L: C: C* H% Y4 x: E6 I
  
" k$ W' h; s& ]) |public sub===Print (label, output)
( q8 E1 G7 r. b, w( _Parameters:  ' Y% k/ d2 B! V. n
   - label [string]: Description of the variable
, z3 k; Y, A* w2 y' M) q   - output [variable]: The variable itself : O0 ^! N6 U+ N! g' Y4 |3 S- ]5 k- ^% b
  
9 ^2 [+ L7 g2 T! A! u/ |( qpublic sub===GrabDatabaseInfo (byval oSQLDB)
, R+ @3 S* f4 @  J. r; O6 A' U# ZParameters:  9 A( ^1 I: W2 B3 s9 b0 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, 2025-7-7 02:08 , Processed in 0.455366 second(s), 57 queries .

回顶部