QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>! K& v1 X0 _, U! ~! X; Y3 U" b  [
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
& \, y0 `, _3 M* U6 k7 H使用方法很简单:
+ [2 |! W/ Q# R7 E: M3 m3 ytest.asp </P>
8 P* |- P7 i( m8 J$ D" h$ G! J<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
3 r+ p; N9 D5 e5 O4 T' ]( Z&lt;%
$ W( l, D9 n3 a6 r1 eoutput="XXXX"
2 Z; S, Q' V/ J3 l" M2 n  t2 t3 OSet debugstr = New debuggingConsole
2 e5 L. u  M& O9 y+ Vdebugstr.Enabled = true ( d2 \2 K8 P7 i, @1 r0 x6 m; x
   debugstr.Print "参数output的值", output
8 ^& n$ R5 u7 A  z- l/ R6 h2 m   '……
2 M5 C4 H0 q" d! _4 D' z4 U  A   debugstr.draw
9 A$ W4 O" d. w7 dSet debugstr = Nothing
+ e& ^7 A7 |& E9 A5 g%&gt; </P>1 Z+ Q4 J- B/ _% c$ q
<>=================================================== </P># t5 W, \4 |; K7 T* Y
<>debuggingConsole.asp </P>5 x8 P+ c3 N2 L$ {+ ~2 ?' Q$ g
<>&lt;% ' C! V& q; [. T* `
Class debuggingConsole </P>. u6 h: s" }/ b* v
<>   private dbg_Enabled . I! @, M- i* Z. q& j& ]( i
   private dbg_Show
, r, J+ q+ D8 O" Y# \   private dbg_RequestTime
$ X7 b5 Y0 L* A3 V* r   private dbg_FinishTime
3 j& x" ?' K4 p5 H7 p* z' r   private dbg_Data , r" J* U+ k5 @7 X& `0 ^$ U
   private dbg_DB_Data
" R# `6 A1 f4 M4 R: F   private dbg_AllVars
' z- B  x; l1 k0 p6 \' H& N   private dbg_Show_default * a( B) I: J% k& {+ {% @+ w
   private DivSets(2)
9 n: i+ y* P* H* g% A   
# S, i( a7 l) V6 k$ ?( b5 |: j'Construktor =&gt; set the default values . D, d6 Y/ N# ^2 J
Private Sub Class_Initialize()
5 _4 p8 y: }$ A, f6 s( c' a   dbg_RequestTime = Now()
6 a0 R( e6 e' w7 X2 F$ c1 g  J5 Y   dbg_AllVars = false
* X) N; Z3 e* O+ R8 W' c, N8 U3 ~   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P># V0 l* e0 Y" W: X6 _6 t: `) R
<>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>8 B2 a+ M4 r% C
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;( H- M: z' Y0 X0 C" H" k
&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>/ ~0 u% N0 g3 R. v( T
<>   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>
- T2 }* T+ z8 p( N2 G6 _7 ?: s5 T" M<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
1 w3 T- ?/ v" f" {; SEnd Sub </P>
( N+ b) Z3 h+ ?3 J& F5 b) ?+ d' ]5 k1 t7 l<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
9 O6 b9 X' k, h% Z   dbg_Enabled = bNewValue 2 M" Y! X$ n6 j5 j
End Property </P>& c8 ]' r3 k: z4 g
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 5 A) a& b: `& l) Y. I% n" X* |+ \
   Enabled = dbg_Enabled ( Q2 Z; {( P5 c) T' b8 b! P
End Property </P># T3 R* ?  B0 y3 F, _& M, \. z* I
<>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
0 [' s. c( t  ]; u3 J   dbg_Show = bNewValue " G$ ?; }" l& [0 E1 o: O
End Property </P>+ U: ^7 y1 @  ]
<>ublic Property Get Show ''[string] Gets the debugging panel.   i5 m6 z, X3 W  l* o
   Show = dbg_Show 8 o" ]6 C; L1 N- Z! X& w
End Property </P>: I9 M( y& o" _% F& E: o  [9 ^1 g/ i
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ) T  p% T+ G8 K1 z+ [2 ^4 I
   dbg_AllVars = bNewValue ( a$ E8 w1 O9 D- ]
End Property </P>7 ?* X% m$ j# e! ?" M
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. % G) M3 t" f+ n" k( L7 [
   AllVars = dbg_AllVars - d: L" w4 h- l
End Property </P>* X: k7 }2 u6 \6 h5 V
<>'*********************************************************** # `  H0 R- y% R$ o1 F5 ~
''@SDESCRIPTION: Adds a variable to the debug-informations.
" Y# Y& }+ o9 G2 ?5 p''@PARAM:  - label [string]: Description of the variable 1 A- z9 u+ |, |; }# {5 I
''@PARAM:  - output [variable]: The variable itself
6 t6 \# D* D, u; O. p; I8 x. C: I'***********************************************************
0 E( x% f( ?  E$ |Public Sub Print(label, output)
5 Z" v# a) R2 `. `* O   If dbg_Enabled Then + _! R- S" M% r1 u
     if err.number &gt; 0 then " K% ~. _* @& A' E0 @3 b
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
% z) ?3 B" r& o. g* e  X! r4 I: N       err.Clear
) w5 {' {) m2 I0 ]3 j7 X* E     else 1 i0 n3 _7 D5 w, E& @9 t: Q
       uniqueID = ValidLabel(label) 8 `1 e9 ?' C- K4 b% N5 }+ T9 Z: Q
       response.write uniqueID
$ I- _' o% U1 \( G) `( j3 s' m       call dbg_Data.Add(uniqueID, output)
+ A" h% o( f8 _9 ^' ]8 n/ ^& D$ o     end if 3 B# g6 V3 |! h0 x9 I, |
   End If 7 v, n4 Y* F5 d( e  x& _* @2 V
End Sub
! K2 f4 Q  D8 a- t! j  7 X# x- a! c0 [
'***********************************************************
% o# K7 X0 T/ ~8 q6 f! t; S# a'* ValidLabel
6 |/ n4 [' u$ H& z* _. N' t  y'*********************************************************** 6 f8 x6 M$ `& X/ H
Private Function ValidLabel(byval label) 8 y/ M7 p9 K5 G" S, ^
   dim i, lbl " @- [7 p/ Z, L3 `# ^6 k8 O
   i = 0 : ~7 a% ~2 \/ Y5 V( Z
   lbl = label 3 }2 h& m. K) e
   do 5 P: C% k* Z2 U
   if not dbg_Data.Exists(lbl) then exit do ' x2 m: P+ S' {& ~, y
   i = i + 1 7 [" {9 Y  c& X+ t
   lbl = label &amp; "(" &amp; i &amp; ")" ) M% f; Q5 g& y* i/ ]9 _& {
   loop until i = i
  r2 n/ S0 H+ M/ f4 T  
, U3 P/ t& G# m$ H8 D: L   ValidLabel = lbl
( J; U" U. Z0 Z4 U9 E( o. U8 uEnd Function 0 J0 v0 A% C8 k' p6 s' d
  
) s3 h( A9 h* G/ c+ L  G) W'*********************************************************** , ^' f6 L; Q' S* e) [0 Z8 o
'* PrintCookiesInfo
# N9 N4 S5 n( m7 x5 I" U1 C'*********************************************************** + \" s$ l% b/ M1 ?
Private Sub PrintCookiesInfo(byval DivSetNo) # |$ T( T/ |: h+ X1 R. }
   dim tbl, cookie, key, tmp
5 A' h, Y; J. y1 R" C1 M7 I   For Each cookie in Request.Cookies 8 c% b$ P; R1 @) U! j) W
   If Not Request.Cookies(cookie).HasKeys Then # |3 q6 B4 [' l, L
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
4 a. T% u# R! b  @3 H   Else # v0 e* d4 ^; M& q- Y
     For Each key in Request.Cookies(cookie) ' ]. T  v5 }  Q( s
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 4 ^! ?6 {* S, t+ }, ]% R6 p2 {
Cookies(cookie)(key))   
$ k5 I6 B" C% g* K( l* J, P   Next : w# }1 g0 O8 W4 ]
   End If
: ?+ ^2 p) T! T- ~  ^  I, t   Next </P>
( p8 ]! w' i* m( @. E<>   tbl = MakeTable(tbl) 2 f6 J$ f6 r8 _% J; _9 ]! N# N
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 0 E6 E9 S7 }% {- y  p  V" f
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 8 d/ i4 g7 o! t  j2 D/ a: e8 d
   Response.Write replace(tmp,"|", vbcrlf)
  }0 j# C8 C* f1 Uend sub
4 _; e" d6 c; F8 @8 X. _  ! l! f4 K; a0 N
'*********************************************************** " |+ h1 ~( D' l! c4 Z
'* PrintSummaryInfo 2 N% Y$ z. I0 X
'***********************************************************
7 I7 i7 r9 C4 d8 X3 X5 cPrivate Sub PrintSummaryInfo(byval DivSetNo)
. Z+ e! H! D0 \) ], A$ O% T+ w6 B   dim tmp, tbl
; {; ~8 f! X5 W) E. y& ^  Z   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
. L' @, ]3 X; \   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
. V$ [; t' w( i# Y& W. w$ Y4 Q+ M   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 6 G/ r+ s3 h, s0 M( n
   tbl = AddRow(tbl, "Status Code",Response.Status)
" }2 _3 Z6 [: ?9 \0 d   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) / R4 b; ?2 b) I. T- T& G- p
   tbl = MakeTable(tbl) 7 @% ?5 i$ C* K/ L0 B
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) / X6 J; h7 K; s4 ^* }- M
   Response.Write replace(tmp,"|", vbcrlf)
5 ^8 L7 Y8 }0 t; SEnd Sub </P>+ z* t7 _8 B2 X3 f8 U
<>'***********************************************************
" a. @( {+ h+ z( K''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
2 S) `! H' D1 t* ^1 X) I& E" J, Y''@PARAM:  - oSQLDB [object]: connection-object ) w' I/ p  N' R, F8 W) Y) h; k
'*********************************************************** & B" {1 h+ O( p" K* i6 Y, M: R1 ~
Public Sub GrabDatabaseInfo(byval oSQLDB) + T: n# o0 [7 q4 j+ y2 A6 S$ q
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 8 _+ L$ g8 t" E7 |. C7 v
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
  Y! c/ Q+ G' y   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")) ; L8 ?6 @  r' C; o
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 0 y& ^: i* H- S/ [
End Sub <>'***********************************************************
- j/ b* m6 t9 [" l$ m9 q- G'* PrintDatabaseInfo 7 b; c( V5 p0 ]6 P9 e0 W/ h, w' J3 b
'*********************************************************** % G* P/ s4 M* J
Private Sub PrintDatabaseInfo(byval DivSetNo)
' g. A4 R4 r6 E1 M   dim tbl
/ U  E3 y9 D; }( b' ~& X   tbl = MakeTable(dbg_DB_Data)
: T4 `6 T1 k5 s3 B; I1 Q   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) $ P5 @+ n- r$ C8 u9 ~8 E  d
   Response.Write replace(tbl,"|", vbcrlf) ; h1 e& ~6 A6 \- O2 t6 E
End Sub </P><>'***********************************************************
# b  P' c- G3 r'* PrintCollection
# i$ }0 K' ]& w1 o+ P'*********************************************************** 6 W) w% z( q1 A3 d5 g* O
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) + A2 @/ g: U8 P5 n/ G
   Dim vItem, tbl, Temp
' o+ j2 w/ \% c7 X7 u9 b: F- z   For Each vItem In Collection
& e1 ~5 N+ O$ z( P/ |  \% [0 c     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then   ?' p' F) `/ X2 o7 w7 i9 l4 C1 k/ v
       tbl = AddRow(tbl, vItem, "{object}")
# m  j6 p' J& }- m, m' T     elseif isnull(Collection(vItem)) then
; M, z1 O' f" L2 |( S( j* Y       tbl = AddRow(tbl, vItem, "{null}") 1 p& t; F) H6 l8 c6 i6 u
     elseif isarray(Collection(vItem)) then
2 I) b( g8 ]! C+ S: H       tbl = AddRow(tbl, vItem, "{array}") % ^8 a, c' P5 M' G$ W$ @7 v  k
     else 2 u% o/ ~3 p7 S4 L* I
       if dbg_AllVars then
  o5 i6 S, E( \       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 0 M! o) d3 x$ p7 e/ I; x
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
9 L! o. g# C  B' ~       if Collection(vItem) &lt;&gt; "" then 8 ]8 k) t8 W/ z
       tbl = AddRow(tbl, vItem, server.HTML
7 S* {/ L$ z. X. F' KEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
/ W; G2 P  A# x* I" U( s       else
/ l+ t1 x5 N) a# D0 y       tbl = AddRow(tbl, vItem, "...") ' ^+ \, R- _( t$ l: H( v' ^& j
       end if
9 j' p! E" F7 C8 `7 y     end if ! D. s0 ?  i/ L
   end if ' I& |" {* m6 ]' ]* m: ?
   Next
4 ?) Y  Y& [, T; a! n) c   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo % D1 _1 X* P3 Q# V
   tbl = MakeTable(tbl) 8 k1 F. A6 f& V8 n* ^7 N: D
   if Collection.count &lt;= 0 then DivSetNo =2
: G3 v3 {4 G0 I0 l: i     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
) O" g' [/ \' P  p, n+ S     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ Q7 [( W0 z/ s     Response.Write replace(tbl,"|", vbcrlf)
+ Q/ m3 v4 N& Z' z/ p" tEnd Sub
, Y8 M! Q6 d0 a. {3 E  _9 \  - N7 g- p2 E% G
'***********************************************************
7 B3 ?% i3 C8 W4 M: @6 q'* AddRow
  C3 J; Z* B! G5 B8 ~0 P( H'*********************************************************** * ^  T& O" _9 s: w9 u$ _
Private Function AddRow(byval t, byval var, byval val)
& l" l4 y+ Z) ?% e7 d* g+ N   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
" s* ]2 K: l+ L. M; H) c   AddRow = t / j( Z. @7 p  Q2 J! A& d
End Function </P><>'*********************************************************** # p+ f8 n0 X# L# h: X
'* MakeTable
0 u  T3 Z0 c5 l! v; }6 n* r$ x'***********************************************************
2 p0 b2 l) t; z7 xPrivate Function MakeTable(byval tdata) 2 f2 _1 C4 ]8 U* J- r
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" % e' d7 ]! O  g! }- S5 \' q
   MakeTable = tdata 0 ^, I' M) L& F. |! ~0 K3 k) N
End Function </P><>'***********************************************************
2 G4 a+ y! n3 y' o" S* H3 }''@SDESCRIPTION: Draws the Debug-panel
0 b; E% T4 f* Y" V: Y'*********************************************************** , P! m! \) t" q! |3 I
Public Sub draw() , X( q0 V( H4 Z
   If dbg_Enabled Then
9 o6 ]" y4 @  Y& V     dbg_FinishTime = Now()
4 N. u8 P) z4 w4 |2 |8 E  
( X% g9 @& m* ]$ ^* e   Dim DivSet, x - i: e9 L6 b; d7 ]: ~! t% {5 v
   DivSet = split(dbg_Show_default,",")
% N4 ~' D- s# R  w: `+ c/ m     dbg_Show = split(dbg_Show,",")
. D0 Z4 ]: [0 L# E; y5 O' {/ U! K5 j+ r  
9 \0 L! s) ?2 T) `' p( ~: e   For x = 0 to ubound(dbg_Show) + i8 l  c1 E9 }2 H+ A; H9 j
     divSet(x) = dbg_Show(x) . }8 u2 K- E9 Z1 v& N. J% I; A
   Next 9 E* \2 b' {/ r" C
  + x# z  H# W8 k1 b& G: p
   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;"   T* y% a( b. [1 _( c, f
   Call PrintSummaryInfo(divSet(0))
/ U& Y4 I. d8 n5 |8 X- \4 w! q  ~     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
  G6 O. Q2 T3 {% K5 f6 c9 Q    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 7 T/ L2 W. |# C; a2 f/ C! R1 @
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") / k# B3 T/ D+ y2 A7 H* B/ B
    Call PrintCookiesInfo(divSet(4))
/ k" Q3 o/ T2 ~    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 t) a4 R! ~6 U/ t+ @    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
7 k5 k2 k, S5 h# S. X" e    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
# f. ^* h# J9 d( j    Call PrintDatabaseInfo(divSet(8)) 5 R/ I) D2 f/ ]+ _; c& ]
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
6 I, u" z. h7 M* {% J+ f    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
" F1 t  G! B! L# Z/ C    Response.Write "&lt;/Table&gt;" , w* l; {2 S+ R. H6 P
   End If 1 `1 U; @. o! \) f
End Sub </P><>'Destructor # i4 f7 n0 P# _4 x
Private Sub Class_Terminate()
' M4 R6 R) k! U6 d4 m5 O% \   Set dbg_Data = Nothing / P$ U3 A' n# ?& J; r
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>( l; @8 i3 H8 v' S3 `  {- A1 n6 c
CLASS debuggingConsole
* W$ o3 C8 W0 r; |, v1 S: m5 CVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
1 a- t" @& e- h&amp;n
/ o; b9 t1 X1 w, i9 l4 x( _+ [bsp;
: v/ A; P& W+ e, s( {& Y8 dProperty Get Enabled===[bool] Gets the "enabled" value + ]- B6 Q2 U4 s
  2 Y4 k8 W  `1 C' 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
7 T) k' X  v/ p0 V6 e3 N' \  
) _0 H9 I8 L  vProperty Get Show===[string] Gets the debugging panel. % ?% \+ {+ N! P
  
! p4 \4 q4 C8 F; nProperty 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><>-------------------------------------------------------------------------------- ' ]! o( L, ~6 b9 _4 w# A
Public Methods </P><>public sub===Print (label, output)
/ \) h" N2 h" w+ Z5 L; W  X/ ~7 E0 Y   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
  M+ p4 X1 h4 ^  b   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
& D  F* w1 ~2 z& X' ]+ M   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
0 x  D8 o: i; f6 F, H. ?Methods Detail # _: v! [2 E' l( v, I
  
9 C- f3 D1 D' O- Y$ A. Lpublic sub===Print (label, output) + Z" Q  Z' x7 Y  @' \7 w
Parameters:  
" \6 B! p- W$ t" W- f- t$ K( f. W( O: Z   - label [string]: Description of the variable
; }1 k* L  A4 G5 V1 w& a2 O  y' Q2 @   - output [variable]: The variable itself
+ U9 X& @" T( L; b) N  
. s5 f  \. }! Z# W, Tpublic sub===GrabDatabaseInfo (byval oSQLDB)   y% [9 B. b; w0 k0 C: n: U: B# n
Parameters:  - j! G8 V" ]& x
   - 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-19 20:27 , Processed in 0.751795 second(s), 56 queries .

回顶部