QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>9 ], y; e& I( S1 f9 l) A
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
0 `. _: v; T+ W6 D' M0 m1 b使用方法很简单:
6 o. D+ \; V' U+ S& d& l, m& Jtest.asp </P>
3 y/ ?/ C& V% W7 c<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 8 w  n& h8 Z& D, _3 R3 m0 G( w4 P
&lt;%
$ Q. O9 S( t& k+ l8 ?0 h% routput="XXXX" - l& r$ I% E. g0 b
Set debugstr = New debuggingConsole
) e) p8 v  B/ H- a' N  adebugstr.Enabled = true 8 @+ h7 t. O/ K$ w! U2 z: D3 J( c- {
   debugstr.Print "参数output的值", output
) j/ [* ?* J4 }# I4 S. Z   '…… ! L) P1 W, W; A+ v+ H* b
   debugstr.draw 0 M) m# v0 [- z* a6 s
Set debugstr = Nothing
6 Y+ `4 F6 ]9 g+ L) U( i5 g%&gt; </P>
6 V, X0 B/ @  X<>=================================================== </P>
# ~9 R1 B) X1 [. x<>debuggingConsole.asp </P>
/ F9 S, ^4 t! v9 |: G' Z% T+ I<>&lt;%
8 Q/ y" I4 {4 o2 X5 P3 qClass debuggingConsole </P>9 A( ?- W. I6 I
<>   private dbg_Enabled # q4 h0 X! s2 s7 E: }
   private dbg_Show
/ H+ ~( m. @. |: T; |6 |" h3 M   private dbg_RequestTime
+ H& T6 X( {3 U: d+ n   private dbg_FinishTime ) w; G5 n3 L7 w: Q+ R. j$ c
   private dbg_Data
  Y3 Z1 N2 ?9 l4 L$ T" c   private dbg_DB_Data . P  P4 @' g' ~0 ^
   private dbg_AllVars
8 b, x$ S) ~) C# u4 H2 E6 l   private dbg_Show_default ! ?" s; r5 s2 ^8 `
   private DivSets(2) & W4 ^& u9 `4 b, j9 o0 U
   
5 \& M- f# G4 s  C'Construktor =&gt; set the default values
8 D( w$ p3 A& HPrivate Sub Class_Initialize() : I/ u( ?8 k1 [1 x
   dbg_RequestTime = Now()
) X  }8 V! e7 N5 A: I   dbg_AllVars = false 8 a- ^: f$ S- Y
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>5 Q  i7 z; ]7 d5 Q. J
<>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>
3 w( n( m6 }2 ]" z<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
! i) ~3 f: R6 z7 V- s&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>
" \% }8 Z/ A/ _- K3 J8 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>
" o% G4 U0 j" W3 U6 w' L( A+ A% y<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
! ^6 `9 Q8 Z1 l6 h9 V" X, D% oEnd Sub </P>
* Y" y( |/ f* O<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
2 w) d1 ?4 Q! c& |$ ]$ t# S6 f9 i2 t   dbg_Enabled = bNewValue 1 H% J' ?: o; \# X0 s! _
End Property </P>
) {& x9 |! K9 O  u<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
! e4 z$ p) _- G   Enabled = dbg_Enabled - s+ q8 D, Q& F9 k4 I
End Property </P>% J3 K( s2 x7 o6 \) f
<>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 ~1 M4 m; v7 T; |
   dbg_Show = bNewValue
2 n' D8 r; [4 d( H& eEnd Property </P>
. j" ^3 O0 G. c* W<>ublic Property Get Show ''[string] Gets the debugging panel. ) S% v2 ^* x6 `! {/ J( C
   Show = dbg_Show
6 T& f3 N1 k- O# C+ B8 fEnd Property </P>+ G+ S' d; i( I6 U8 B$ `
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false , S$ U1 d# D3 m
   dbg_AllVars = bNewValue
: ]0 p4 [$ x4 _: Z: e8 A6 P( NEnd Property </P>
/ u  n3 V* F' O$ m7 J$ X* W8 s<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
- s9 `0 \' `3 q  h( X' O   AllVars = dbg_AllVars 0 b, A& b1 n& D  H; Z& A
End Property </P>
+ O: \$ c) h7 U/ r( V<>'*********************************************************** " Y; k+ ]: x5 K. M
''@SDESCRIPTION: Adds a variable to the debug-informations.
( q0 E$ `/ t9 r7 O''@PARAM:  - label [string]: Description of the variable ' ]* |5 \% ]+ }! c# O1 R; U2 @. g, U
''@PARAM:  - output [variable]: The variable itself 1 B- r$ m8 B' {7 }8 {* J# a! T
'*********************************************************** 7 K; W1 F: _" l- l) J% \
Public Sub Print(label, output) 9 A& e9 T7 ?( z* \: J0 r
   If dbg_Enabled Then
- l; P5 o4 |. r" w5 {" J     if err.number &gt; 0 then
1 |% K7 @! [" [- Z: C       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) ' p6 d: @4 E+ \: P4 c
       err.Clear ( Y( I/ X& b* M- o) {/ f
     else
, \% Q4 b% c7 O" G# T; ]% [; ~       uniqueID = ValidLabel(label)
' Y4 z& T( `/ N0 O: V3 P) n       response.write uniqueID 2 d* T* U; Q; b! b1 X
       call dbg_Data.Add(uniqueID, output) 9 E0 u: M$ A6 @% e0 q$ \
     end if ; T( G$ ?3 i* @3 Y' H3 T' F# C$ H! p% d3 x
   End If
4 z3 \$ b  ]# m0 EEnd Sub
' r3 w* D6 R+ h  % G) A8 N7 P, w
'*********************************************************** 5 T7 Z- \; O. C% Y! E
'* ValidLabel
6 L" n2 j0 R8 I2 {8 w$ G( C( G, A+ p'***********************************************************   \5 _& N4 M" C: |$ j; }3 o
Private Function ValidLabel(byval label)
" M& n1 }0 o1 m  _   dim i, lbl + V$ S4 ~# L7 G# M% ~# X3 [+ F% V
   i = 0
( S. g, }/ ?" @# a   lbl = label ; j* L* t; H" R; a
   do
& q( `9 ?: Q8 x2 q% K   if not dbg_Data.Exists(lbl) then exit do
; h: p8 [7 m) ^& ^   i = i + 1
' s4 G- P1 k' b, p# }' A   lbl = label &amp; "(" &amp; i &amp; ")" & Z! W) Y$ U. M, b2 a% e) Z( u
   loop until i = i 8 w  g0 w0 \# G% _" T
  
6 a6 w' |; C* ~7 x) N* X. P; B, }- n   ValidLabel = lbl 4 o; W" s0 P4 W) z1 l0 t- Y
End Function 6 _, E" ~- [  L9 x. @6 r4 e8 k: S
  
+ M- [& b. b2 g% ]8 H'***********************************************************
5 K& ^' D, ~+ P'* PrintCookiesInfo - }" o" ~6 K9 n# D$ W
'***********************************************************
& d0 u' @, B7 @; yPrivate Sub PrintCookiesInfo(byval DivSetNo) 6 p( n. [" \, V4 x  b8 ~6 _" l' \6 M
   dim tbl, cookie, key, tmp
6 u& n( o3 f  c' h- t& Q4 l   For Each cookie in Request.Cookies
4 F7 |, p8 a- K  m8 u   If Not Request.Cookies(cookie).HasKeys Then + |' F9 |+ u* a% |( |
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
1 x, T: ?- x( ~1 e# i1 a# q( ~1 C   Else
6 @* ]/ u& N7 W7 A! W     For Each key in Request.Cookies(cookie)
! x" f+ l; k6 g: n9 S- J     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
/ D. u. u1 h/ n0 [: CCookies(cookie)(key))   
) m& C& f: ]- l; d, ]; b% h   Next ' c( I0 l* w7 S
   End If - j% M& _" [: A8 h  g! o( J% {
   Next </P>. ?9 _2 e' Q2 s' Q: ?) c
<>   tbl = MakeTable(tbl) ( d- x% L0 A& D9 w; i/ s" ?
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 7 o% ?7 c/ X/ x! E
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 2 ~# w3 q7 K1 g- Q- f; G' C
   Response.Write replace(tmp,"|", vbcrlf) ; _' Y# ]. n) _- I4 H, l! t& S- P
end sub / W: R" J1 M% ^# d
  1 J$ `7 Z' u3 e% B3 k4 g. |7 X8 p
'***********************************************************
$ l6 B# o$ E: t$ L! S'* PrintSummaryInfo 4 J7 q1 W0 l/ r! ]
'*********************************************************** + t# z! W3 ~4 l+ h- d" s9 ^
Private Sub PrintSummaryInfo(byval DivSetNo)
! ^9 k$ D8 ]+ y  [6 v   dim tmp, tbl + r/ ]( G: p6 e- G9 P) s
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
: z9 g2 }7 P$ W8 a! O8 A   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
8 t- P) i5 Q! G& _& ?0 W   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
5 O% N1 q5 a2 e3 Z. b   tbl = AddRow(tbl, "Status Code",Response.Status) + k  U8 U$ ?+ X% p2 c! [  S" L
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
* {5 z& \# ^+ {) K; l3 w   tbl = MakeTable(tbl) % W6 @; j6 q/ i5 ~/ w5 ]' P" v
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
% \" o2 J" h3 D* G   Response.Write replace(tmp,"|", vbcrlf) ) J- |/ _6 m7 Y5 @% K/ Q* n: j: r
End Sub </P>- O) \  m, j  \# v& ?
<>'***********************************************************
5 m7 }. x3 b6 E& q& y) W''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information ' |) \2 P4 `+ o$ C: l9 a/ d1 j
''@PARAM:  - oSQLDB [object]: connection-object
) P1 ~; c7 P& h2 j4 n# {'*********************************************************** " R+ h! x7 C5 U% w, \: |, v4 z
Public Sub GrabDatabaseInfo(byval oSQLDB) : K- N7 h6 J0 ?5 b9 p
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) # Y' s( `4 o0 Y4 R7 e8 m) a
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) - T1 w. n+ O6 s3 f5 D5 @4 i
   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 T" @3 p. w: |, v   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
4 `" J4 Q" S& h; Q7 I% S* z  `% lEnd Sub <>'***********************************************************
1 E& T  K# m1 \: ?" c5 i'* PrintDatabaseInfo
$ v# y2 D! W8 T0 p'*********************************************************** . ?, `* g  B% j. j
Private Sub PrintDatabaseInfo(byval DivSetNo)
9 b& u; D0 _% h   dim tbl 8 I4 }, U* E  t' ]. z# N. ?
   tbl = MakeTable(dbg_DB_Data)
' t2 M/ d: y* G( _% v1 v   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) . F& r- ^- [( m
   Response.Write replace(tbl,"|", vbcrlf)
, i/ e' m# h' ~" u" s2 ]End Sub </P><>'***********************************************************
! q0 W' }6 G9 U4 }4 B( Q+ |2 k'* PrintCollection
7 k! y9 v1 H5 r'*********************************************************** 5 T+ ?( O7 r3 `; C6 i
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ' j8 o) z- T3 U6 g( z
   Dim vItem, tbl, Temp 8 i0 C8 t' I. e9 `. `6 {
   For Each vItem In Collection   H2 @" t2 w8 F& n. e! g* C
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
. I6 ~; Y% p! h, d# V' {1 y       tbl = AddRow(tbl, vItem, "{object}")
. H, R  u  X% b( |& ^     elseif isnull(Collection(vItem)) then 5 R! u: R1 K; P4 y! x
       tbl = AddRow(tbl, vItem, "{null}") ! S) X& P# p$ I, [4 C, X
     elseif isarray(Collection(vItem)) then
" I8 Q7 S* C( n2 ]' P       tbl = AddRow(tbl, vItem, "{array}") ; d* I2 [2 o, t# ]( u2 @: H6 y
     else * m) @% j3 @, R/ n
       if dbg_AllVars then ( D" x8 v1 U5 e1 K0 ]9 `
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
) J: [6 _2 ?) O; g! Q     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 3 g, {; V1 M: n5 m) y* \1 r
       if Collection(vItem) &lt;&gt; "" then
. y( j) G0 I# ]! T  Q/ p" l8 u       tbl = AddRow(tbl, vItem, server.HTML# G  i8 x* \. W% }3 n5 F
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") . b4 V2 d* ?0 z  e3 P
       else ' k4 B+ Z+ Q2 A$ W
       tbl = AddRow(tbl, vItem, "...")
, q: ?* X" B/ e5 M3 ]) C       end if
0 B' j) T7 Z" c! t2 U! n! i; J- T8 f     end if 8 Z4 n9 c6 z6 ^* j
   end if
- _' R) M8 y  @9 i+ R" ~( g   Next
: J  q( E  Y. c6 F# q   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo 8 I. ?! ]. P5 A( j+ k8 q7 S$ D
   tbl = MakeTable(tbl)
! @$ w" Q4 P0 V+ D6 G9 e. Z0 H   if Collection.count &lt;= 0 then DivSetNo =2 , F6 a# R" f, {7 j+ Y/ n7 _
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
) d7 D2 M6 E$ d, ?     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
: {( h! a1 j! Q0 b     Response.Write replace(tbl,"|", vbcrlf) # u6 F# p4 l) w# f& w. p, Q
End Sub
3 w# H3 a( @6 x/ V, H. V$ e7 l  2 K& P& m: Y( l# ?( V& Y- L( i  R
'*********************************************************** 3 _6 E9 n4 F7 p/ g. }; X2 f
'* AddRow
& c" S; a3 [8 n" {2 S'*********************************************************** ' w0 [' C! ~/ p" c1 [
Private Function AddRow(byval t, byval var, byval val) 2 @- C8 T+ N( B4 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) f1 s9 c& j) n& t3 v# z
   AddRow = t
/ m" @) G7 k: t+ BEnd Function </P><>'***********************************************************   q9 q! D) X7 \& D. j- U
'* MakeTable 2 x8 D! {7 H; f  N" V
'*********************************************************** 2 @9 o6 C6 [: j
Private Function MakeTable(byval tdata)   Y5 u/ L  d% Z+ i- j, g$ L
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
& u6 l2 W7 R2 ?$ b/ h+ g   MakeTable = tdata ; c1 b2 z/ H' E8 ]0 G4 b" Y$ N
End Function </P><>'***********************************************************
& J3 ?; \$ w7 G! E2 @$ s' [/ H''@SDESCRIPTION: Draws the Debug-panel
4 B( N9 T: Y! K7 j' s'*********************************************************** 2 c2 {* d: r4 @* A- {: _
Public Sub draw() 6 A& \3 p6 D& u$ q0 w
   If dbg_Enabled Then 8 E; C) N3 M) h* x$ O
     dbg_FinishTime = Now() 3 t' B- T1 [# J& |! U
  : r7 G0 A/ F9 `# E8 g8 s4 I
   Dim DivSet, x 6 ^: Z- e" w, H0 Z2 L1 A7 @
   DivSet = split(dbg_Show_default,",") 0 m5 F$ K1 L. M& R2 O3 s- |! n4 w
     dbg_Show = split(dbg_Show,",") 0 N$ s, ]' r- H6 P
  
* H+ }5 T) v* S& _# U2 t   For x = 0 to ubound(dbg_Show) , j/ {0 B) G0 j" k' h4 C* c
     divSet(x) = dbg_Show(x) ' @( N+ Z( @! c2 W
   Next
9 u, Y+ e4 g# j/ K' q: I* j  $ }2 m; |& a1 K8 @1 j. Y% D* n
   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;"
1 m8 r' b# W0 n6 Y, W' E/ f  |   Call PrintSummaryInfo(divSet(0)) 4 O* [# W3 ?2 G1 j% v/ ]/ n5 n
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ) w. X2 ]& _0 g# O5 p' E9 v3 C7 B
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 3 k5 v8 z& h$ n3 |! k8 i: H
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") . u) a4 }5 E8 h$ w& S5 T- N
    Call PrintCookiesInfo(divSet(4)) 9 p9 C+ W$ N/ h) Q' w
    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 T; Q2 S+ _3 D, k: o4 b5 s$ H    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
. P. b: F4 M1 R/ D7 T5 n6 V7 m. v    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
" H" R3 ^. G& o7 [    Call PrintDatabaseInfo(divSet(8))
1 j( o* ~" ]; I/ g  C. O    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") * Z$ h1 |) }, ?* R* Z$ L; O
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
. W+ ]7 Y& Q  l& W  n1 p    Response.Write "&lt;/Table&gt;"
5 V3 T8 q( h' g5 M   End If * k1 y* k) E' P$ s$ K* |# n
End Sub </P><>'Destructor
2 Y. |. Y  f' ?: WPrivate Sub Class_Terminate() , ~6 S. E$ P5 k3 u/ @
   Set dbg_Data = Nothing
5 D( k$ e* I" ~End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
+ Z' j4 i& c5 B: q+ T- v. X' iCLASS debuggingConsole
: k: i5 b, |; x& o  X2 T8 T- C* i! wVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
; S& N; M( E* c&amp;n
  H$ G; k+ M* R+ C# F3 Gbsp;
1 u) @5 n4 F; g0 S6 KProperty Get Enabled===[bool] Gets the "enabled" value 3 w: c. n* J/ t1 o1 u+ p
  
* ~- _" v( H3 ?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 2 `2 ?, x9 a8 l2 e2 f. [3 \
  * [, @  e/ ~' z/ i5 ~
Property Get Show===[string] Gets the debugging panel.
# [8 r3 x/ z) T& `  
; z# G: T8 d8 ^0 o2 M9 PProperty 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><>--------------------------------------------------------------------------------
, J+ A0 F; E- N0 F9 x$ m2 S: ~0 nPublic Methods </P><>public sub===Print (label, output) : W2 x  Q# k5 O! Q+ G  I
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) $ L" ^; V) S& ^9 I( W/ z8 X/ v
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
! i; J- v5 ~' K9 b, \/ V   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
; c5 C, _* J3 z9 q1 P* b4 a0 SMethods Detail % V0 w: ]% l) G4 A- ^
  3 E9 D3 q5 u1 [: [# X
public sub===Print (label, output)
+ n; S0 ~# X: Q  DParameters:  0 K3 j$ e5 T1 C9 A- O! N- F& W7 n
   - label [string]: Description of the variable
/ U$ A; \! D9 ]4 J   - output [variable]: The variable itself
" T, ~$ Z. N* a$ |6 g, L. B  " x& z" T* h. x4 ~, _: A
public sub===GrabDatabaseInfo (byval oSQLDB) " q( Z& Y1 o) W. R
Parameters:  
0 v3 t( _# ~$ D0 n- u/ 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, 2025-7-9 05:44 , Processed in 0.369910 second(s), 56 queries .

回顶部