QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
& c8 P( S- f, Z<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
* U- B4 `/ H/ j- \9 q使用方法很简单:   D! g$ q' W9 x$ M9 S4 a8 A+ l
test.asp </P>
, d  o0 z7 O* ?2 J* N; R<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
7 s1 _- F( X' n5 k# l&lt;%
% f5 {6 W, D2 H  S$ t4 M2 K3 poutput="XXXX"
0 Z( Z7 R& p4 G! V. p1 KSet debugstr = New debuggingConsole
/ o- L/ s+ ~: m7 J" u$ c& edebugstr.Enabled = true
1 Y' j" i; F0 Z8 f   debugstr.Print "参数output的值", output - d, a. j% F3 R1 A, ?0 e+ k- s- z
   '…… 7 w; A& P& l% u7 k) Q: L
   debugstr.draw
8 M1 L8 H& i& ^) X# O! t- _; G& FSet debugstr = Nothing
6 q. t; @8 l  S: f% I% K%&gt; </P>
# a; o" g2 U( w* J% H4 r<>=================================================== </P># H0 r% [0 c# n  z' n( B2 c
<>debuggingConsole.asp </P>% V0 v5 F6 I5 e4 [
<>&lt;% 5 F. b* K6 d% u8 J
Class debuggingConsole </P>; x3 q% n9 f. N: n# g. T- h7 _
<>   private dbg_Enabled / }. x7 A7 u$ R) j# S, L5 ^
   private dbg_Show
$ e- f7 w3 F5 m9 z9 p' F: z+ x   private dbg_RequestTime
( ^6 [+ j5 c4 H0 j   private dbg_FinishTime
3 G9 p3 |5 t2 v   private dbg_Data
" A# l! r* f8 ]   private dbg_DB_Data
5 r1 q5 q1 f! a) {   private dbg_AllVars
3 D5 a/ J" N; P; p- g2 Z3 e   private dbg_Show_default
' i( |1 ]8 i% W   private DivSets(2)
  E  L/ v, K& P4 D2 d  |8 X+ o   
# Z% R2 D; J; P/ i4 K4 [6 G'Construktor =&gt; set the default values 6 C8 a2 L. p: `% f; w
Private Sub Class_Initialize()
" A2 Y4 ]# r; ~/ ^) n7 x8 f* ~8 n( E   dbg_RequestTime = Now() # ]6 S5 f/ h0 v
   dbg_AllVars = false
( O8 S- S) K2 w   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
, B) D0 m- z* F<>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>+ W8 r* [' P( D2 k, ]) v
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;' \1 X! D7 x7 _% m) j% 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>% b. K+ |. E; ^/ ~8 M; `
<>   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>2 K2 P, S4 v$ a1 v* |7 N6 I
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
5 o; X) ?4 t4 B7 sEnd Sub </P>: O, B# X; b/ W/ A3 [9 A5 d9 V( G0 C8 Z
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
, C) E) A# t% x# x5 Z+ X3 J   dbg_Enabled = bNewValue
0 e8 {# y4 n% g% w, u& z- B+ wEnd Property </P>9 Z; p2 k1 |. x( |% r9 ]0 J3 M/ z
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
& R9 w8 E% H! f   Enabled = dbg_Enabled 4 j8 I( }9 y9 J0 ?! {1 f
End Property </P>
" S( n4 z5 `' D  R<>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 * P7 h, H0 u7 g9 t# r* Z3 I) [
   dbg_Show = bNewValue 2 |! ?! e+ i" P, p# K  W
End Property </P>
6 M/ t1 x: |& L/ Q<>ublic Property Get Show ''[string] Gets the debugging panel.
5 ^# m$ ~0 q: o/ Z$ d   Show = dbg_Show - ^, D2 Q0 ^1 w$ c9 w5 `: T
End Property </P>
" E) X( S/ K7 O; v6 F3 S3 ^<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 7 R' c: Q& q9 V! |1 R3 a
   dbg_AllVars = bNewValue
1 Z1 J, O: G( u/ Z# }End Property </P>8 F7 `: q1 e1 Z9 c- K7 U
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
( u1 C9 K  [( |2 z5 y3 [, n. w   AllVars = dbg_AllVars , [: |# u. f" m3 f& N! q: H
End Property </P>
# P! h8 `: _, \7 z* G<>'***********************************************************
0 J1 I8 d1 f, ?0 f$ f/ @4 M4 C7 D0 l''@SDESCRIPTION: Adds a variable to the debug-informations.   P( P) n7 j' I1 i
''@PARAM:  - label [string]: Description of the variable
8 h+ K# k3 t! k) V" I8 |# u''@PARAM:  - output [variable]: The variable itself ' y( I( D. \/ A# G; w( X; E
'***********************************************************
: _! N( c7 I5 }' b/ H3 FPublic Sub Print(label, output)
# c2 h  l& i6 P   If dbg_Enabled Then
9 \% j2 s( u3 P* g7 u+ ?( T' V' @     if err.number &gt; 0 then ; O% J0 d# e  }% M6 O
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
3 ]7 p; S3 D  w, \' `       err.Clear
) n- I; l4 U- Q  W5 _& l. {     else
9 R! |& |# s& Q) f- P# P- p, E       uniqueID = ValidLabel(label)
) a  r1 ?, f( C0 h# I6 v/ ~+ E# E% D       response.write uniqueID
1 U# a" p8 X9 P6 Z9 q/ P/ a6 _' G" w       call dbg_Data.Add(uniqueID, output)
7 b  z5 {* {4 y( T" i  B     end if
; G! G/ m9 @1 k  q   End If , J+ k7 x4 d# P9 G% }$ `
End Sub ! w/ h5 E& ^) F6 Z/ @+ M% v
  
3 U9 u% u  l7 Z6 H'***********************************************************
/ @/ V6 a+ H4 Z7 v: |* q" a'* ValidLabel
6 p, s. e$ |* ~- g5 l8 g+ w' z'***********************************************************
0 n! t/ Q) S, @Private Function ValidLabel(byval label)
) c7 K4 g1 T- V( B. T1 P; ]   dim i, lbl * D/ A& v! H& u# {; O0 Q- K. ]- z
   i = 0
% Q) t( u, V$ _7 r/ X5 B7 ^9 ^! u; l   lbl = label 6 g; D7 C$ x, p9 y( M* I7 z
   do
. J( y6 i; L4 k- B   if not dbg_Data.Exists(lbl) then exit do
; Z4 }2 W) @0 ?- X   i = i + 1
4 w- E. f3 \, X5 n! F   lbl = label &amp; "(" &amp; i &amp; ")" 8 a4 {4 w+ o: d3 a2 J
   loop until i = i
* H# ~1 [* s  h% s$ L5 Z) j% g  
9 S" c, a7 k1 `& ^' _   ValidLabel = lbl - Z6 B3 W( N+ F. o' i
End Function
$ i1 J4 r. `! G% t  
. n+ c" |7 s2 C6 J3 t'*********************************************************** 1 d5 E2 i% P5 ?) F
'* PrintCookiesInfo
! I' P0 d6 x' G( a; D, k. o'*********************************************************** - O& j2 D# O9 \* U8 O; o( p3 E' T
Private Sub PrintCookiesInfo(byval DivSetNo) ! ^' }" c0 [4 J
   dim tbl, cookie, key, tmp 5 d& g/ g; x5 M$ H
   For Each cookie in Request.Cookies
9 J5 D( a( t* e& n  P+ B9 J   If Not Request.Cookies(cookie).HasKeys Then
5 \+ R1 l' `9 _7 D9 G/ s+ h+ O     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
: c0 N9 E: x. G9 }5 y( m   Else 3 Y' Q/ L  Z2 d
     For Each key in Request.Cookies(cookie)
0 u  K& }5 [: i     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
' c& @. D$ F- {" t9 iCookies(cookie)(key))   
3 e; ~- v; V7 T" }6 P   Next
* f7 o3 p3 F: m* ^' ~0 j   End If
. V( a( ^+ l$ J9 _7 u   Next </P>
3 `# U# m8 x- n/ r) w<>   tbl = MakeTable(tbl) ) U* o' F3 W% s; Q5 s. e" a
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 # R  v( X! J6 I9 l& ]; q5 ?, ?
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) ! ?4 ~% S: r; O9 z
   Response.Write replace(tmp,"|", vbcrlf) % c# W% f; h% f8 @7 y  Q6 s
end sub
6 Y5 ?# Y# N: ^  |; R  
. Y* ~3 T$ B* [. x  y+ T; {'*********************************************************** 3 r' [5 z0 B2 ~% [3 f! V
'* PrintSummaryInfo
7 c$ Q- P3 Y. o'***********************************************************
+ V/ M0 \+ L$ j. w9 n0 APrivate Sub PrintSummaryInfo(byval DivSetNo) ! O: R: t! e6 R  |
   dim tmp, tbl " a; s( ^  c( Y$ x+ G" z
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
* q9 J/ d( r- C& m   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
  }' `" Z$ @+ r( R' {   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
( o$ f' F0 N% ^6 G6 l   tbl = AddRow(tbl, "Status Code",Response.Status)
4 v3 S6 _/ z" a0 Y   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) " ~; P1 p2 X; c2 N- h
   tbl = MakeTable(tbl) % P( y1 r) G# G8 R" x- v; h
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 7 G: a. x0 g4 b+ q1 l# h/ F" o  o7 c: f
   Response.Write replace(tmp,"|", vbcrlf) " S6 a5 q8 P& K, B
End Sub </P>; @0 ~- }. y- }( ~) r
<>'***********************************************************
2 {+ Y7 j) }# y* |: [/ R; w''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information $ i( [  L: `  c) i
''@PARAM:  - oSQLDB [object]: connection-object ' ^, q: ], v& o+ s4 _" d
'***********************************************************
* X5 [+ \' p, H4 H3 F, ?Public Sub GrabDatabaseInfo(byval oSQLDB)
" C+ f* O# a9 d9 P, E, }1 h   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 6 }- ~- B% Y( B6 E2 d! f. [! e
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 2 p% l: b' }. O1 _8 l9 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")) , m' c, y( o! t  ^# {  a: S# k
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))   j7 c& i7 |. |) Q+ u7 s/ B
End Sub <>'*********************************************************** ! p* D: M6 Q! m
'* PrintDatabaseInfo
4 A( k6 O: |8 e3 d0 \& T: O5 B3 E8 R'*********************************************************** ; d7 g* O7 G: G
Private Sub PrintDatabaseInfo(byval DivSetNo)
+ s# X  p7 f; g7 @* P* z. j   dim tbl
& b" c2 k" g3 h* W" c9 Y% @: E# I7 ^   tbl = MakeTable(dbg_DB_Data)
$ [0 Q  s3 C! Q" K   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
$ {5 c: U- `5 k; x, o- t9 F   Response.Write replace(tbl,"|", vbcrlf)
' U$ P$ K) d+ x- Y0 Y) SEnd Sub </P><>'*********************************************************** + e/ L. B% Z, H! d) J, q& R# c
'* PrintCollection
7 ]8 z8 L; r) A+ ?! m) l2 ~! N'***********************************************************
2 _0 u$ v  s; L: P8 E3 ePrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
4 h; Z0 Q0 M: f   Dim vItem, tbl, Temp
6 y; X) V9 @+ r( E  b5 ]' u' k, ]   For Each vItem In Collection % v* S6 z& y; n
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then + N4 c9 m' A* ]6 M. k% `( c% k. N
       tbl = AddRow(tbl, vItem, "{object}")
0 w% f: w, |! N5 k4 Z* D' S     elseif isnull(Collection(vItem)) then
! d5 ]* j  x, q; a$ T$ J6 S$ |       tbl = AddRow(tbl, vItem, "{null}") + y' m$ O2 ^7 t2 E5 U
     elseif isarray(Collection(vItem)) then / z4 D7 K* ], K* C0 b( S
       tbl = AddRow(tbl, vItem, "{array}")   v# C: p, i" J1 z$ e$ W8 r
     else % z, E  O. s/ T# b0 Z  U/ C! _$ F
       if dbg_AllVars then 1 N' M+ d5 P0 r- q+ [
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 6 ?: e& I6 `8 `6 h, S1 v( s& i$ Z
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
$ s! c; P6 w8 m) F# W: z       if Collection(vItem) &lt;&gt; "" then
+ A6 V* ?) C% C) @       tbl = AddRow(tbl, vItem, server.HTML
. l1 {' M% A! j3 T$ I3 L4 {0 EEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 7 r& q2 V- T5 Q) |+ l
       else 1 Y7 ^6 d2 g! K7 i
       tbl = AddRow(tbl, vItem, "...")
, T0 J6 @6 Y% t5 P  c% w* x9 ^       end if
$ d2 G9 G  ^( u( V+ U9 `7 `     end if
: `6 P2 t; E) O1 ~0 Y4 N" c   end if ; x. R6 S1 W/ b0 U$ u& X: M9 C  C
   Next + j& {' o4 h" O( k, L6 }5 A/ g! }/ v
   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 _% _" y1 C- K/ v8 g: C
   tbl = MakeTable(tbl)
, m( u: q6 y+ Q" v   if Collection.count &lt;= 0 then DivSetNo =2 ! \+ A* u+ u: n/ X3 E
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
# I7 N" ]$ m) B5 ]- U     tbl = replace(tbl,"#sectname#",replace(Name," ","")) + I+ w1 @" T" R. O# `) e
     Response.Write replace(tbl,"|", vbcrlf)
$ o8 u! C4 I; Q; [; w5 i& Y) `End Sub
1 u! e3 ]2 F; q7 g+ }5 t1 ^  
( }5 w, X, {. w* U2 n4 @'*********************************************************** ! d# A; F/ }$ W+ R* U) f, p+ q
'* AddRow + {) W: X2 t  ]  |- h
'***********************************************************
0 W9 Z6 r& _2 O3 PPrivate Function AddRow(byval t, byval var, byval val)
  ]/ a; e' u4 q$ F6 I: |9 T1 s5 A   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
2 x) E0 H& t& ?$ F( w   AddRow = t
# M  d. Q$ ?( f0 v/ }End Function </P><>'***********************************************************
9 d( Y: y  s* ^! X: x  P' i4 V/ w'* MakeTable
+ B/ ]& K4 i* w* z, v. j'***********************************************************
& r$ |7 x  y6 d* X9 tPrivate Function MakeTable(byval tdata)
2 M* M: r" P" b/ O" v# @   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 5 w5 W4 e" T; K/ _  Q$ K
   MakeTable = tdata
2 ^8 v, v' P: J4 R0 ^; [End Function </P><>'***********************************************************
* S6 c1 a' U' ~: x0 D6 I''@SDESCRIPTION: Draws the Debug-panel
; r$ v& W+ Y+ Q7 `; @'*********************************************************** * l" r3 x6 }' t3 p
Public Sub draw()
1 }& m; m/ L. |- P   If dbg_Enabled Then
6 B, h4 O) s+ |1 r) v( b     dbg_FinishTime = Now()
; r% f1 l- k) j( h- e. Q  
# k* \/ Z- J! W$ w8 ~0 Y   Dim DivSet, x
/ [9 s5 V& B0 T   DivSet = split(dbg_Show_default,",") " `' [$ I  R2 v+ G, v8 Z
     dbg_Show = split(dbg_Show,",")
7 J: |9 U8 F0 J$ `9 j  
( d/ t1 F/ E$ i$ V9 r  Q   For x = 0 to ubound(dbg_Show) $ I; Q; c9 q7 {* g/ H" _; p, ?% l$ X
     divSet(x) = dbg_Show(x)
5 p, t6 N; ?5 d+ m) b0 q' o: t   Next 4 ?: E. s& D; V" k3 p
  
6 ~9 A# o, H5 D   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;"
* e4 K8 V0 J$ b6 w9 k0 C+ l   Call PrintSummaryInfo(divSet(0))
' ~2 y. U( Y. g: G* e     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
3 N. c0 o& n9 u$ K: Z9 U    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
; c) W% U, u! f9 ]( g5 k    Call PrintCollection("FORM", Request.Form(),divSet(3),"") , i+ z( r* F& y6 D
    Call PrintCookiesInfo(divSet(4)) - G: L0 u4 O; w6 Z) l
    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))
' L+ l' T+ \1 [3 ~$ d+ ]# U3 [    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
. ]. _. V- X- v9 m' O7 H    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
# u0 ?% x6 ]# v7 q3 R9 _2 z    Call PrintDatabaseInfo(divSet(8))
$ C9 q2 }2 n0 q! Y! Y    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 3 D( Y0 v/ S- G: o) @- g( Z; X
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") , j/ U$ B/ a% U
    Response.Write "&lt;/Table&gt;" 0 ^+ i$ R4 T7 l/ N, ]2 Q
   End If * B3 z; m- l6 m0 c  ?
End Sub </P><>'Destructor
$ J# d& p$ w; C' R' P3 IPrivate Sub Class_Terminate()
6 I3 `* Y+ h- H4 c$ c2 z/ t   Set dbg_Data = Nothing
4 m% P# j5 j5 `) o" p8 pEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>- D4 _5 M( L# y7 T- E) R; w
CLASS debuggingConsole # n/ C0 \1 c7 u8 {' r; i/ J; j
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 6 }1 Y* W2 e8 j/ [. F# u3 F6 V6 p
&amp;n+ Y) t$ P4 s7 o: z! j8 ^
bsp;
3 i# t8 [( t  x- r9 s' o- RProperty Get Enabled===[bool] Gets the "enabled" value & ~! d: y% Z! g0 K( D
  . s: h! e; T: q# ]
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 z! _1 h7 s! y! n& ~8 y, a( |  
7 {' R% E: \  ]& `Property Get Show===[string] Gets the debugging panel.
" {2 `9 M6 z  q: r6 E7 K& `; U  
9 ~/ \' ~9 v: g, p9 X& W6 z% ^: OProperty 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><>-------------------------------------------------------------------------------- - a: d  Y, j- @9 z* A$ X( D* V7 t! c
Public Methods </P><>public sub===Print (label, output)
0 Y; f* E9 I6 H2 W% U   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) " {" a* f0 G- |' C; W) B% ?6 V/ u
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
  t2 l/ b3 ~" q- _% M  ]2 g   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
9 [: t+ J7 {' ]  X' }  KMethods Detail
  I! `" H& ~: w& Y) |  
/ j) I' Q0 b# I: l0 J4 Ypublic sub===Print (label, output)
% V0 J; e6 B! D; @) D9 i) G4 nParameters:  
3 p& t, A! e3 [2 q  L   - label [string]: Description of the variable 1 \3 I9 E; N7 r- B
   - output [variable]: The variable itself
  h, c" ^- d8 W* P7 B( _  
$ t+ r6 y+ a5 N4 ^public sub===GrabDatabaseInfo (byval oSQLDB) ( w6 i% ~* W% e  k/ b) S9 S
Parameters:  / V5 o* e$ s% C
   - 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-9-20 01:43 , Processed in 1.107700 second(s), 56 queries .

回顶部