QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
# [1 \' p% ~1 _! M% e<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ; r- W, o& p" _; A
使用方法很简单: 1 I1 {( F. F- A; N. m
test.asp </P>4 V2 e; q4 L/ L4 p' `& [1 d
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; # y3 D( i& D& ^, |- w: [/ D& e$ x. l
&lt;% 1 i3 L% s+ X8 m" d) G! @
output="XXXX"
" m: `5 D0 N! Z- i# U+ ]Set debugstr = New debuggingConsole " ^' c6 y7 |( X- U& H. a3 r7 p* m
debugstr.Enabled = true " w! w: I* D  c5 p  a. T
   debugstr.Print "参数output的值", output
2 Z" h0 ]; S/ S. E1 @: a8 `$ |   '……
! p: f! S) F! L/ E3 ~0 v$ E: T   debugstr.draw ' h' J: j. o7 I  [
Set debugstr = Nothing
8 f0 \0 F2 c: d& [. A) |%&gt; </P>2 h$ l( G& K8 n& }  L: |
<>=================================================== </P>
6 X% u" `) m7 M) c# y<>debuggingConsole.asp </P>0 T# Q& M5 Q9 i: l; ]
<>&lt;% ( I$ u/ v( M; p" c( i& h
Class debuggingConsole </P>. F+ }0 q8 m& e2 r" o5 B7 I
<>   private dbg_Enabled
, g8 Z. P: A7 w# n/ M0 F   private dbg_Show
% r7 m. m7 ^& P  P   private dbg_RequestTime # t5 {( q9 n9 ]( {$ H
   private dbg_FinishTime
) k7 k: h% w7 C3 e/ I   private dbg_Data " U$ c% q, g0 z
   private dbg_DB_Data 4 S- V! ?. A# F9 e/ W  B
   private dbg_AllVars 4 A- |4 \, i$ ^
   private dbg_Show_default 2 N4 Y# c, `: B5 ~6 y7 X
   private DivSets(2) 9 O/ @: n3 s' c' g* l. X1 t
   
9 N9 X7 k  N1 z4 H7 G, P8 Z'Construktor =&gt; set the default values
+ j! M- M+ `) m# o# t" |$ v1 _Private Sub Class_Initialize()
) o, k4 \; l9 t3 s: O   dbg_RequestTime = Now() 8 |6 N4 j3 F! G$ y1 P6 h, {" n* g, s4 H0 q
   dbg_AllVars = false 9 d; W' `  X) J
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
; {6 C" x# R2 y) t7 ^<>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>& B) N6 E1 U$ A8 G# a
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
7 J2 L( M; w3 |/ C  i' F: W&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>
2 L+ T9 S& Z5 {! l1 I. _<>   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>+ m& L$ z# ^- _8 ~7 U, @( S
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" + J/ s* X. g" q' H$ I7 S
End Sub </P>, K1 b6 i' G* I& I* X- U
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false % }3 f' l  }8 L3 h5 t% b
   dbg_Enabled = bNewValue
' {& r8 A8 F9 w* OEnd Property </P>
0 h6 q3 c7 G2 L, C<>ublic Property Get Enabled ''[bool] Gets the "enabled" value * k3 u6 w! T/ ]2 F$ R) e
   Enabled = dbg_Enabled
2 y( n8 T# M# y$ i( O  `- F$ n: NEnd Property </P>
  x# |* R9 S: V( ~0 b+ Q1 l<>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 _) v1 x9 o0 b! G! }
   dbg_Show = bNewValue
7 g5 h$ G' S6 ?6 k$ zEnd Property </P>
9 `% H% W+ G) U/ n* s1 Z+ y- n<>ublic Property Get Show ''[string] Gets the debugging panel.
8 ~' y! ~. l+ F9 p   Show = dbg_Show 8 J9 ^( k- v2 H" T9 m! l  T
End Property </P>2 f. f( M. _7 j+ _
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false * d  ^8 w" k* r# N+ S' |
   dbg_AllVars = bNewValue $ L1 C' R: `( m7 V+ L
End Property </P>* G6 \( _9 k' Q: ?% |
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
- S! K8 e5 z2 s   AllVars = dbg_AllVars
; I. j& b* ^1 s9 B8 pEnd Property </P>
# F! Q+ u1 o& U8 b" q+ I<>'*********************************************************** , r3 e+ o, v7 i) g6 F* @, L/ J
''@SDESCRIPTION: Adds a variable to the debug-informations. ; d  Q$ T; X7 p* O8 Z0 L
''@PARAM:  - label [string]: Description of the variable
- ~3 r; C# F: k. `8 f, ~# r''@PARAM:  - output [variable]: The variable itself
# W0 P6 e0 c) D( t'*********************************************************** 6 T7 r4 u2 X1 s, I
Public Sub Print(label, output)
6 D4 ^! M' `. @8 v   If dbg_Enabled Then . b8 Y8 t9 ~5 R) d* b7 M
     if err.number &gt; 0 then
" g9 k* R/ Z6 F( y8 B       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
0 P4 Q' ^1 ]! P: G% ~3 v       err.Clear # `6 ?8 u$ k" q, @3 v
     else * r, H5 m  g- `/ Y5 i1 @
       uniqueID = ValidLabel(label)
( ]* ~+ l) d/ s( `       response.write uniqueID
. K6 g# j( _( y/ ?% u       call dbg_Data.Add(uniqueID, output)
1 n5 m) t5 m- K7 ~  n3 U. i     end if 1 g* Y) x" S* O9 W/ C
   End If
- d' u6 z7 o4 w3 `End Sub ; q8 e* }/ `, w/ g  ^6 ]4 k
  
7 P1 P9 [' D4 ^' m5 t2 t'***********************************************************
, K' l0 L3 V; K1 y, _% E- a1 n'* ValidLabel
4 t# N; B8 D( _& F0 p'*********************************************************** ( y( P! P8 ^; C( O# R6 d+ T/ ]2 ^
Private Function ValidLabel(byval label) ' l/ S2 V- h! N% f
   dim i, lbl - O! S2 v2 w% J  t: g& ?
   i = 0 4 d  H! g: }/ H. V; y, u8 V
   lbl = label 1 [$ c' U! I/ P- }/ `9 [3 @9 L
   do 3 _4 e5 f. g- Z! s& S' ]: l  W6 |
   if not dbg_Data.Exists(lbl) then exit do
3 j( {+ E8 J- F3 [3 W" }# G   i = i + 1
  I& t5 ?2 N/ z   lbl = label &amp; "(" &amp; i &amp; ")"
" W, A9 A) W; [, M9 S   loop until i = i
; n5 L: i- I; P' \& ]9 `; z  % z; D- Q1 ^5 _7 E8 M8 O  K
   ValidLabel = lbl
7 t# m. D5 J+ {  C9 E5 O. i6 ZEnd Function
1 ^: e- `& X6 m: L# L' a3 x) J  
3 Z! F" \& M; a) U) R3 N: P: z'*********************************************************** : }- k+ J7 n% T8 K# b9 l6 m% ]) K6 @" ~
'* PrintCookiesInfo
+ e0 @1 M$ K+ J! b9 w- }'***********************************************************
! a. q; [3 i/ k$ T* K6 |$ R5 D6 Z+ TPrivate Sub PrintCookiesInfo(byval DivSetNo) # l$ T3 `3 N: V7 o2 }) i3 v) B# `
   dim tbl, cookie, key, tmp
! Z$ q6 z0 e8 F4 e2 I, a   For Each cookie in Request.Cookies
& R! D+ Z3 d* ?" [8 W   If Not Request.Cookies(cookie).HasKeys Then 9 ]# V+ s. a0 y5 R; X
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   * p" N9 l0 u2 X0 i+ @2 V
   Else 6 D5 [. |2 `0 P( m8 I  b
     For Each key in Request.Cookies(cookie)
& k& f, c: J& c3 K- Y" W6 O     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 7 o% @3 d4 N/ \; Z$ j% q
Cookies(cookie)(key))   
) k3 X, C6 h* N9 Q! ]" y. _. b- `* |3 Z   Next
4 x) K. M3 m! W   End If 2 k" P8 J2 Q4 _; t; _, T6 b
   Next </P>4 y0 H, p' O8 m  F  R5 C
<>   tbl = MakeTable(tbl) $ }% H0 W2 _4 M( Q* k
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 5 e9 w: C+ {2 R0 x) _  }6 ?
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 3 B% Y9 a. `  G5 G' V9 Q* g
   Response.Write replace(tmp,"|", vbcrlf) & I# B0 S( @& m' s
end sub . H# p) w; V4 d! j0 q
  9 ]! U2 S2 u  H: |) }
'*********************************************************** 0 V! d/ Z6 K6 V  `. Q9 Y) r4 O
'* PrintSummaryInfo : P) u. V2 m) }9 ^) \$ A
'*********************************************************** 9 L! a& l9 X0 o2 s
Private Sub PrintSummaryInfo(byval DivSetNo)   y7 i/ E  @! g5 ~# i: r: @% n9 w
   dim tmp, tbl 9 d  X! ?% e/ i% C: E# j; }
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
& H( k9 v3 O7 x- j: y& W   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
  K# D3 D' ~9 `/ C8 }0 e3 E4 y3 n) N   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 9 c5 |$ P7 U- A2 x9 N
   tbl = AddRow(tbl, "Status Code",Response.Status) ' |4 x% ]) a$ f- B% [2 _+ V
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) ' x. J8 w0 I6 ~" T- U: Q# I& V! u* Q: ?
   tbl = MakeTable(tbl)
/ g4 ~% \; \4 K' F   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 0 O( ]0 ~# R- Y; S; X' a7 X3 c2 _
   Response.Write replace(tmp,"|", vbcrlf) 1 G4 z% P4 ]. h3 m
End Sub </P>0 v' J6 p$ Z. W. ]: N7 B" G
<>'***********************************************************
! @5 z! O$ {% }) o( k# v  i/ z''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information & i' b  f6 v) l) v
''@PARAM:  - oSQLDB [object]: connection-object 4 e: F& t; }7 z: x
'***********************************************************
7 e  [/ i( e  _* V* jPublic Sub GrabDatabaseInfo(byval oSQLDB) ; v# F; ~( e5 f4 C3 F4 C% n
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 9 }# {- o, Z: a4 k+ W$ S
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ) M  g- F7 H  R% O# [3 @9 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"))
- q+ e/ W& [5 M) {# b1 J% ]   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) ( s  W8 ?+ S% L7 h- U
End Sub <>'*********************************************************** " ~7 d( G' x  h5 H5 r- P$ T$ i
'* PrintDatabaseInfo
5 }1 B! T, x- k+ Z5 }' q'***********************************************************
" h/ O+ H; H. k' o  WPrivate Sub PrintDatabaseInfo(byval DivSetNo) 0 ~& e' e' v2 Z( P
   dim tbl
' R, ^0 A- ?+ [# x9 r2 O   tbl = MakeTable(dbg_DB_Data)
7 e7 L& Y% z; j   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 4 G8 Y4 u+ A9 R0 }4 L
   Response.Write replace(tbl,"|", vbcrlf) 1 A: r1 i) Z) V9 A3 \! P1 Q
End Sub </P><>'*********************************************************** 1 d7 E8 {% w4 f6 N1 [% e6 y9 Z
'* PrintCollection
* f1 G* [3 m' L8 V: p# t'*********************************************************** ) ^) S' @0 T" y, t# j6 o
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 5 L, A$ D9 I% [: D
   Dim vItem, tbl, Temp / Y. G, J( D$ G0 A
   For Each vItem In Collection
" A1 w8 e: q, c: D- X" _     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 6 a# g' S. u0 ?: d
       tbl = AddRow(tbl, vItem, "{object}") # Y4 V, g. i2 p2 l. D0 N& }
     elseif isnull(Collection(vItem)) then
' C5 I4 ], _6 Q4 t       tbl = AddRow(tbl, vItem, "{null}") . I$ Y2 p1 r7 @. A$ s( R
     elseif isarray(Collection(vItem)) then 5 Q: u3 m) j% d+ B- e2 f  `
       tbl = AddRow(tbl, vItem, "{array}")
. D$ l' A# Z  y/ ?1 \% p     else
  L$ W. z' [/ ^( y% X! l       if dbg_AllVars then / G, D  @2 J6 P. P& L7 Y
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) " @. R  D0 A6 d( [/ d
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then - D- _5 j/ [2 N
       if Collection(vItem) &lt;&gt; "" then
- _; S* p3 c0 U9 q/ U       tbl = AddRow(tbl, vItem, server.HTML0 u7 b) ?9 k% Q0 R0 [
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") ; S' W; i( L2 Z6 c  U4 q
       else
3 K$ N- V- D2 x. b% H, r6 a. O- q       tbl = AddRow(tbl, vItem, "...")
! c  j# \5 X& E' U" l2 I1 \6 \       end if : M4 \, u! I  R/ @) m& s
     end if ; E' S0 ~$ z) H2 k! c, ^
   end if
8 @$ |& V% y% |$ v1 ?- U   Next 4 q( g7 p- E; i) z: f) }# b7 e' `
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
$ b1 e" i3 ]$ f' h6 R5 a' d- t   tbl = MakeTable(tbl) 7 b5 q1 |/ y! V9 X
   if Collection.count &lt;= 0 then DivSetNo =2   o4 a' K3 _7 J2 M+ I8 p- m% B
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
$ A/ e% c* z4 W& E4 p8 g     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
% P  I, B; l" I$ E% P: T7 q     Response.Write replace(tbl,"|", vbcrlf) 3 ]  _/ S/ J- W) {
End Sub 7 k7 i4 g$ i6 Q, |
  
: B4 L! y! T( H'*********************************************************** $ @6 G8 y2 k: j
'* AddRow
/ M" k! @& S6 V'***********************************************************
6 }: y( R& |) Y) @1 d) ~& ?/ GPrivate Function AddRow(byval t, byval var, byval val)
& A: e( B* U+ g7 E6 U   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
; P. ^7 q' ?# @. u: ~$ T4 @   AddRow = t / Z3 ^  d! @5 j$ N' V, z
End Function </P><>'***********************************************************
9 P- E' ]4 h; W' a4 o, T'* MakeTable
) M- K6 b5 y0 ]4 r4 f* S3 b% @'***********************************************************
# \, a8 b% a, p" t3 X/ QPrivate Function MakeTable(byval tdata) ! x% {1 z( a; P* ~
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" + A5 v, i0 d" A
   MakeTable = tdata 2 R0 N3 N; o/ Z6 N5 g8 l
End Function </P><>'***********************************************************
) U/ x6 Y4 ~9 t''@SDESCRIPTION: Draws the Debug-panel / T: g6 \: L; q; F9 }& J  G* z
'***********************************************************
0 d' @" e& m; i8 B- dPublic Sub draw() ( q# v5 C& l- V/ N( `8 J. |/ N+ D
   If dbg_Enabled Then 9 Y! Z7 r% Z3 W. r; P
     dbg_FinishTime = Now() 8 o1 J  x& C+ U. G: W: i
  
4 W- g3 V9 }9 B1 F% J   Dim DivSet, x
' B. V' p8 k% R1 t* N6 h8 K   DivSet = split(dbg_Show_default,",") 3 f1 h- P" g9 E
     dbg_Show = split(dbg_Show,",") 5 X9 y5 o( S: r( W/ v2 ?
  / H' E5 p( F# V: k7 K
   For x = 0 to ubound(dbg_Show) 7 ?$ ~7 n8 {. b, q0 o8 \- [
     divSet(x) = dbg_Show(x) : U0 A& v3 T& E8 I8 y$ L$ p6 g* S
   Next / g! Y( \- e! f3 C- L9 z: j
  ( J) u% T; b/ J8 i# O
   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;"
' F8 ^) ]1 W4 D/ y   Call PrintSummaryInfo(divSet(0))
' ~. M- w- R0 X+ j9 v9 @" x4 F     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
+ M3 \9 J" B: ?3 J: G    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
$ ~' ^7 C6 l8 V" m    Call PrintCollection("FORM", Request.Form(),divSet(3),"") , \! r, L+ N# {6 u, p; |
    Call PrintCookiesInfo(divSet(4)) - e( i6 y9 m* o1 d
    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)) " k: C! q4 r3 G, x
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 3 X1 h; p( }) H) ?
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) + g5 [, |7 E+ a" m$ q& T: v2 t3 z
    Call PrintDatabaseInfo(divSet(8)) 6 S8 Z0 ?/ y1 X& X8 T2 J( f9 x
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
  `  U6 C4 d  R* d( o    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
/ v3 F8 `6 f, O6 ~    Response.Write "&lt;/Table&gt;"
* n' N$ B8 ^) D0 }( f( R   End If ( U" S7 P" P1 V  D
End Sub </P><>'Destructor
' \4 t0 l0 N$ I8 ~! Y& HPrivate Sub Class_Terminate()
7 `, U: c9 d0 P5 ]% Q   Set dbg_Data = Nothing 3 M% Z9 ~2 f8 X" s( Q! d: E
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>' v0 \' \! D6 r! B# `: v* O
CLASS debuggingConsole * c9 F& L1 _  @0 A, w9 b8 B% r
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " S  N: n9 L7 k4 E% R3 U. r- O
&amp;n
' A, P$ Y- t$ M+ F* n8 r3 U& fbsp;   s; u5 |% b# B: X
Property Get Enabled===[bool] Gets the "enabled" value + O3 A* D" \( N3 [4 e8 _
  # G* ?! A$ E. d- G' a" j  @9 t
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$ i  [: P. {+ o( h+ M
  
: N/ z8 l2 Z! @) r# |3 }( aProperty Get Show===[string] Gets the debugging panel. . g* G2 Y1 X. m0 M5 M' d# B2 }3 w
  ; p9 _$ z" K/ R+ \, a+ q
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><>-------------------------------------------------------------------------------- 8 f2 |- _/ n# t+ v: r5 [/ w" M
Public Methods </P><>public sub===Print (label, output)
- P# `5 [2 b6 P. T; V   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
2 H+ V- S/ R1 a) r! g7 E   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () $ j% y& N1 I  {6 d; Y9 B( e
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 7 e/ Y) [9 v- K6 H# c
Methods Detail
% F3 F, h8 M4 d& }4 x1 U  
$ W; M3 N7 ^% {$ t( k6 ypublic sub===Print (label, output) + P" B' y0 s3 T8 s  Q3 v
Parameters:  + m  @+ W9 }7 a9 {
   - label [string]: Description of the variable
9 r7 P2 X* `" n/ _9 }9 h( J' F   - output [variable]: The variable itself
' \) I& j! t& ~4 b" d1 a/ M* n  
3 ~/ }, Z" k8 D. o, P4 apublic sub===GrabDatabaseInfo (byval oSQLDB)
) k! j) U$ v+ hParameters:  
! p7 \3 v  y  s1 {4 L7 w, P   - 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-14 03:33 , Processed in 0.418485 second(s), 57 queries .

回顶部