QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>: _. ]! C, n0 s$ o& K- y- G
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 4 I* J1 k# c8 U2 z' U- A! d% n( H0 z
使用方法很简单:
: k* ^. ]. v4 c" E- Ftest.asp </P>
' M; n# k8 h7 n: @/ f8 t<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
& k( R7 D* N3 L3 i) V$ j4 B+ Z9 h&lt;%
: x8 @4 C2 p8 W: Q9 i4 r4 Routput="XXXX"
2 b: G4 Z3 q& D! K8 B$ e% MSet debugstr = New debuggingConsole . R. w, c! z2 [( |: V8 H* q) l8 J
debugstr.Enabled = true 6 c1 E9 }0 t$ a: ]( ~7 ?
   debugstr.Print "参数output的值", output % c7 D9 M$ e" q. \4 M
   '…… : ?5 H+ g2 o9 U* U5 x
   debugstr.draw
4 ^3 G6 o) K6 }% @: C5 CSet debugstr = Nothing
+ [0 c+ x0 y3 r" d+ T%&gt; </P>, r' m/ ]2 {; `+ s4 Z! n
<>=================================================== </P>
! D0 G' I) f- a; L! Q" N<>debuggingConsole.asp </P>
8 T6 C. b5 w. G<>&lt;%
7 ^& |7 R# `# y$ ?/ `% A* tClass debuggingConsole </P>& ]  |0 g3 [. e5 Q+ c" u2 c" |0 [
<>   private dbg_Enabled ; E" b% x' {- C% ]' C. O( f, n( w
   private dbg_Show 8 q& x! p3 ^' Y; x" p5 _
   private dbg_RequestTime
( n6 ]; L1 _" T5 k  `" G. e* L   private dbg_FinishTime
9 [/ K' w/ G  ~% D& y# \; b2 y   private dbg_Data ! e% k3 b1 h  m
   private dbg_DB_Data
6 K9 c7 B6 g5 j$ Y0 D( q   private dbg_AllVars
6 j" E% @% N( j   private dbg_Show_default & u/ n8 _) F2 W  d( c4 r
   private DivSets(2)
9 o4 u; v9 u: Q2 e$ m; M; d5 |3 [   
3 D7 z7 m. P; i- D: H9 R' Z; e'Construktor =&gt; set the default values
" F; S3 w" y3 F: b* E" d# PPrivate Sub Class_Initialize() . Y# ?& s+ c3 I- y! a$ @
   dbg_RequestTime = Now()
; G, Y" m4 ~& m: G2 n5 Q   dbg_AllVars = false ' c) ]8 c+ x6 b" B+ ]! Y( i
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>9 Z! U1 \0 }  _+ ^
<>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>' _6 |( h: i* z# K6 w, P
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;8 c# p  O( r3 x7 q' y7 E
&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>" P" _# n- Q& T( Q0 i! N
<>   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>
7 o7 L5 b9 V' p8 |- C) q' l% n% u<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
, b9 o7 k8 E" d/ xEnd Sub </P>
" _: s. _) m" T2 t9 H0 r<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
& j( f* q3 K* X, Q0 ]1 t: F# C   dbg_Enabled = bNewValue ; M0 b' E7 F% j5 S. q4 _% o
End Property </P>
& r7 ]9 i) `$ b  e- k- k<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
6 O/ A- F# \. Z4 B7 t   Enabled = dbg_Enabled
  N! D* ^6 d! _- o, k% u+ gEnd Property </P>! J/ G# `: v; k) t5 Y, K8 {
<>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 x1 b& _4 T( L6 z4 r4 E% F
   dbg_Show = bNewValue 1 R% \. }8 B2 v
End Property </P>
3 S; e, d' X" \% q4 j% f<>ublic Property Get Show ''[string] Gets the debugging panel.   H1 u  f2 B7 t  y9 I7 q" F
   Show = dbg_Show , e. x, b/ B7 M3 q8 \2 l7 \+ V
End Property </P>) ^0 X2 [) Z+ A5 S, C( W2 H
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
# E( _& w3 ]( v2 ~# L- d5 D   dbg_AllVars = bNewValue
- P9 a5 y! ~$ s' ~& h4 REnd Property </P>' _$ h9 v3 D! k# n
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. : |6 `: R8 n3 s! _; O; c
   AllVars = dbg_AllVars 1 [6 z* [+ f0 r0 G
End Property </P>  P$ R, i* \' n* u# T- b
<>'***********************************************************
3 d3 j, A( \+ C* l) p3 v+ J0 G''@SDESCRIPTION: Adds a variable to the debug-informations.
6 C9 h, l: ^) s1 p/ G''@PARAM:  - label [string]: Description of the variable
; d* _' F! g/ i3 |% @( }''@PARAM:  - output [variable]: The variable itself 2 q8 k8 A: h1 x/ W& p. I# T& d
'***********************************************************
3 B5 j. k! O8 a  p& MPublic Sub Print(label, output) & l1 U. P, `5 f
   If dbg_Enabled Then
0 _/ e/ s0 w% a     if err.number &gt; 0 then
! A" u% c( N" K2 w. [       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) , }7 a: s- p2 x: B0 W
       err.Clear ( p- L7 ^& M, Q/ W& r( N
     else 7 h% R$ J% ]8 r
       uniqueID = ValidLabel(label)
7 F' p3 C8 z$ a" y6 l- I% S       response.write uniqueID 3 W8 I) v7 K5 o5 r0 ^& u' A
       call dbg_Data.Add(uniqueID, output) * g! N) n6 W; S3 }5 r
     end if
: J4 I4 x% `  Z; {1 C* G) {   End If ) T1 m3 @6 u+ w# ]5 `
End Sub ( n; H& E* p6 ~  @7 m2 ^: u
  5 u# z  [/ w. k2 o0 N
'*********************************************************** ; I2 {" W- X7 ~- [; W$ _9 I
'* ValidLabel ) S' y7 \8 l2 I
'***********************************************************
. _; v+ S( W* lPrivate Function ValidLabel(byval label) ( i- B* q! ?/ q7 d
   dim i, lbl $ r2 T4 A) M3 S" g( A2 N
   i = 0 6 u! {1 N* u% F# M1 O7 F$ v+ C' J
   lbl = label 6 _  @* d4 c  g& h$ G$ z
   do
' }  ~& F% Y% O) ]8 M   if not dbg_Data.Exists(lbl) then exit do - n, v" [$ B  A7 Y
   i = i + 1 7 \+ Z; N: [* C2 G0 A# m
   lbl = label &amp; "(" &amp; i &amp; ")" . K0 L8 K& D: Y' N
   loop until i = i
) |3 f4 a0 m* }5 r4 F  ' H+ G, p0 Q; J. b  q" i
   ValidLabel = lbl * D" P  m. h, c& {6 r4 @3 d
End Function
! W/ p, S. \* }  # b" M" w0 Y( B) `1 ~" M: S
'*********************************************************** $ o. I0 [3 a! a5 ?% v! V% b$ p
'* PrintCookiesInfo
/ g1 L3 B2 I3 \3 }'*********************************************************** 0 j& U: D) A( G8 v4 ~* x
Private Sub PrintCookiesInfo(byval DivSetNo)
% ]4 m+ Q; ~6 ?3 S   dim tbl, cookie, key, tmp
3 J; ?/ s" G; D' k- V0 s   For Each cookie in Request.Cookies
$ C$ k' t8 F# p% q   If Not Request.Cookies(cookie).HasKeys Then 8 V: J2 ]5 k4 w6 u7 J
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
$ ]+ Y6 @1 [% v3 Q: {) M   Else
8 b8 ^& c- s4 e. F( ^8 `     For Each key in Request.Cookies(cookie) + v6 k' V5 O6 f! c+ Y# a
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
4 h5 _5 b; {# C- @Cookies(cookie)(key))   
  l8 T& N0 u2 q9 L& F: _6 @   Next " ~# x! T# e, w" R0 d8 n
   End If
6 o1 F' U4 w7 l7 {. p! k5 O5 r) w2 f   Next </P>5 H0 O4 a- G7 C
<>   tbl = MakeTable(tbl) $ c+ D# U5 O! P$ `8 ~+ n, z, I3 p# k: Q
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 * x1 @. C. a$ j. `3 j& _  b. e, ]
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
$ n3 P. R: H' s7 z   Response.Write replace(tmp,"|", vbcrlf) ) W: j$ `# G) P6 R
end sub
, x0 I2 W* `4 F/ H! S; ?2 V* H+ k/ L* t& d  : b  F- V/ R* w3 A
'***********************************************************
; K! E# o' c9 f" s/ h8 t'* PrintSummaryInfo
6 `, R( z' H8 X; z2 h& c9 z'*********************************************************** ( {+ _  ]: l" p# u% P& L
Private Sub PrintSummaryInfo(byval DivSetNo)
5 ~% Y; O+ U$ R  I   dim tmp, tbl ; p) Q. q& L7 C/ F
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) % J: H; U% `) z9 h2 Q$ d
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") + K4 ~; o! z, m* }3 u8 o; w
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
7 p% b" i# C1 c- r* E% }" @; p   tbl = AddRow(tbl, "Status Code",Response.Status)
2 h! g7 F! ?  C. @7 w, C2 Y   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
% }; G3 ]+ X, |# C   tbl = MakeTable(tbl) ; x& w7 j" P1 `; r3 c( D3 R
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ) a& j5 ]8 B3 Y4 i" i+ g" p
   Response.Write replace(tmp,"|", vbcrlf)
$ B$ d* `5 Y0 v9 P8 uEnd Sub </P>
  R, e) [' ^- W$ S6 p<>'*********************************************************** 5 ?) L2 w0 ~  o; R; z  I( E
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
6 G$ c  ]* R; I% [; I- U0 T2 S''@PARAM:  - oSQLDB [object]: connection-object
+ @- D9 q' ~3 t- u'*********************************************************** 4 W  |: O+ I0 V
Public Sub GrabDatabaseInfo(byval oSQLDB) 7 d" x4 N* C: V; `- D
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)   `# j- H$ l; A1 }, v' ?, W
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) * k' N# z9 x& O( l* |3 X$ A7 Q
   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"))   l! O8 {# \; i0 \
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) - f- H+ V3 K% S" {' u/ @* u# r
End Sub <>'***********************************************************
2 `! M. K" ?" ^, H3 e2 ?# E" D4 p'* PrintDatabaseInfo
' m6 {; E3 b7 g2 _1 b  D'***********************************************************   |: x' B8 }5 n; q! ]& O
Private Sub PrintDatabaseInfo(byval DivSetNo) . t6 Z& i3 N& V
   dim tbl
4 W0 `) Z0 E/ x4 p% S' a- b3 \* e   tbl = MakeTable(dbg_DB_Data)
( z6 B, m5 j) c9 c" |+ F# g' b   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
  M' \8 G+ K1 a, G   Response.Write replace(tbl,"|", vbcrlf)
% G" r/ ^' y2 N1 `5 n! y) ~End Sub </P><>'*********************************************************** # F7 j; E, @  c
'* PrintCollection
* U1 `$ K) Q' M+ M2 E# H; q/ ?'***********************************************************
% ?* R; K8 u9 s3 x9 o# \5 F; ePrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
8 k/ Q1 H! ~  ~/ P   Dim vItem, tbl, Temp 3 `" l0 T; Q6 W8 n& F- F
   For Each vItem In Collection + W' |+ ]. ?+ T5 J5 E$ [) t4 G
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
* P2 u- k) K3 n2 B( b7 K) r/ _  f       tbl = AddRow(tbl, vItem, "{object}")
) U: z+ J1 v/ B5 P6 W, k- `6 }     elseif isnull(Collection(vItem)) then " v0 i: X: o8 h% p( b2 I
       tbl = AddRow(tbl, vItem, "{null}")
& n3 W' F9 X( i" L# C     elseif isarray(Collection(vItem)) then
3 m2 c8 h0 c) K8 T1 D       tbl = AddRow(tbl, vItem, "{array}") 4 o# w+ \8 q" E" k
     else
% i8 Z4 {6 S8 X5 O       if dbg_AllVars then
; k5 E1 J/ x+ c6 v4 |       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) - u$ S4 H8 f/ h0 B6 m
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
9 P/ L' J% K0 O       if Collection(vItem) &lt;&gt; "" then
/ n2 o, h" J, c3 C       tbl = AddRow(tbl, vItem, server.HTML  H4 D# I% _: {; I! u9 j
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
2 L  L  b+ O- Q8 Q4 ]! @       else
. a9 w! O# ^2 h3 @, A* u5 ]- [       tbl = AddRow(tbl, vItem, "...") : G6 H; b+ [+ T! C
       end if 1 t6 |, r5 Y+ Z5 m  C
     end if
" G4 S" C% r4 k0 |& @8 ?   end if / m6 i0 d3 f! `" V$ {
   Next
3 s" `9 a& m3 W1 x   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
5 F3 Y3 ~+ O( m1 u( }: M% o   tbl = MakeTable(tbl)
  T# ?# d- Q# _* q/ ^   if Collection.count &lt;= 0 then DivSetNo =2
6 G' g! d: `1 x- ?1 s. i     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
0 p$ ]) l' q# c9 a     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
/ ~1 A1 E! [# \. w) k1 _     Response.Write replace(tbl,"|", vbcrlf) + P% C- c( E0 ~+ T7 Z, C$ b# C
End Sub
, o; T/ M& k" `  " l9 I& b' k- O  a
'*********************************************************** % i( v4 R6 R1 R3 g, @
'* AddRow
: ~4 S4 j( _9 c, D  @. r, N0 q'*********************************************************** / d. a; C6 F" ^/ a0 U2 r
Private Function AddRow(byval t, byval var, byval val)
! W5 d4 D4 J- ?5 G5 T   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
) o: d; P) o1 Q( V6 C. a$ R   AddRow = t
  |$ Q7 v& P% _& n- xEnd Function </P><>'***********************************************************
- `, y. s% L3 @0 m2 z$ W1 H'* MakeTable ( L) H& {  e# Z! d3 S" G" N2 ?
'*********************************************************** % w- O- b4 p4 P7 w
Private Function MakeTable(byval tdata)   x  O; a5 G5 S0 m# Q4 i
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
+ L: w9 C4 k2 ?" Z   MakeTable = tdata
' {  y. ~$ U- I3 p) r! PEnd Function </P><>'***********************************************************
: P+ b6 _7 K, H' P''@SDESCRIPTION: Draws the Debug-panel 4 w: x' g2 K) s" ^3 U' j
'***********************************************************
! j" W5 N8 J0 F% @/ u2 Q* }* tPublic Sub draw() 6 \1 `3 I# r, R7 ]" _' O
   If dbg_Enabled Then
, r. l& u& ]$ O/ U; r% A     dbg_FinishTime = Now() & v0 v& E% b/ ^0 h8 x2 m, {) [6 U: H
  
, l1 P& T8 E- |4 J   Dim DivSet, x
; S' C. ]" Q: T! a' i' f4 V/ u* o: `! q. M   DivSet = split(dbg_Show_default,",")
- S" O# G( s  g% L; Q3 N6 `/ |     dbg_Show = split(dbg_Show,",")
; S# X2 C5 {* t! `7 x  $ ^1 K0 S. x2 w  O
   For x = 0 to ubound(dbg_Show) ' d; r" B% L% h
     divSet(x) = dbg_Show(x)
# V. l! @$ `7 S4 F   Next
; p# N) D4 T- t$ ]6 _. e2 {  - C8 w+ X2 ]4 k, S
   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;"
: j1 |7 L/ e5 u( |4 f: I+ |2 e# W   Call PrintSummaryInfo(divSet(0))
4 \4 ~% E& ^! u$ i  a     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ' Y; u4 r. z, r8 S
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 5 z* S0 ]1 ^9 ?# D
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") $ Z! n* @' I) r- ]4 U
    Call PrintCookiesInfo(divSet(4)) / C$ m% S8 C$ L7 L; i+ {5 z
    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 v9 H, C8 |/ e! I  S# r( s
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ! i" v6 Y8 z7 |& z5 j6 P: v
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ( _  l' a: L2 ]0 B
    Call PrintDatabaseInfo(divSet(8)) 0 g% a% Z, \3 q4 P
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
2 \+ N; i3 m' D5 U( I9 |4 `    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") ( ?: C7 p3 `) E" ]0 `( N: k" H
    Response.Write "&lt;/Table&gt;"
# J3 z, H" v/ M# a8 S2 |   End If ! W. Q- A. M0 \4 E7 R: x3 p
End Sub </P><>'Destructor , G' f  U. ]0 M( r
Private Sub Class_Terminate()
+ d8 {& f  T% h' |' e9 k   Set dbg_Data = Nothing
1 x% Q' @' e  ]8 v  R# EEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
0 V1 c0 D% ?& I. b" bCLASS debuggingConsole 6 b3 o$ v! i; E2 h
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
7 s  ~# O' m. G# J3 Z9 o&amp;n
# L# l0 t: u: mbsp; 6 T/ A; Z% L- |6 i5 E" P9 R0 k# `
Property Get Enabled===[bool] Gets the "enabled" value
* L$ h& S( R, h- E) b  
. Z9 ]2 {* r  [; G# z. ?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 4 @' g! C! O8 b+ r
  9 \! z' s: @9 [$ H3 ]  S: q( L( k
Property Get Show===[string] Gets the debugging panel. & s  }1 |1 r( @' _, H' \* \
  : ^( n9 {: N8 H# {$ V9 V0 Y' [
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 ~- S! _3 Q9 F- W& {5 FPublic Methods </P><>public sub===Print (label, output) : w, O' M( r! j# E5 q& ]
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) : W0 [% w. S' D6 \4 Q$ E# j7 x5 I! t4 i
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 3 p, m" C9 w/ p5 I0 Q' T
   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
$ z# _5 q, y% Y3 @4 m/ SMethods Detail . `) I" i0 }" P. Q6 e
  
1 Q5 z' V8 \. J% {) kpublic sub===Print (label, output)
* q4 v: k# M% s* \% j2 D8 a5 N; IParameters:  
: v5 l# r7 U2 A/ ^0 R" A* P! }   - label [string]: Description of the variable % Z! t: B+ z& W) c- T# m
   - output [variable]: The variable itself . C- y8 K0 U" W  j; m1 a- d
  + K+ E/ {% c" X5 h6 {$ h5 ~
public sub===GrabDatabaseInfo (byval oSQLDB) 0 f0 J+ X5 V+ P5 t' M. w8 s
Parameters:  : X$ X2 _0 M" s% t- x" l
   - 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-7 21:27 , Processed in 0.911765 second(s), 56 queries .

回顶部