QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>3 o& K: {. ]+ h+ W1 E8 Q; j3 X! B
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 6 O% x5 }! F! H: j1 _3 e, L2 s
使用方法很简单: " F0 T1 H5 X* T
test.asp </P>& z' H! r8 W! B6 x/ \& o# D/ h) D
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
; I8 L; p5 `* E5 k3 N( K7 ]&lt;% - _$ \) k: ]# d6 E$ t) Z, u
output="XXXX"
1 u7 X, o5 w! E, [9 p. _Set debugstr = New debuggingConsole 5 I+ s# e; B/ }( A; o9 R/ P
debugstr.Enabled = true % c, M7 g. x: t, A
   debugstr.Print "参数output的值", output / m3 c( P* D1 ]
   '…… : \7 d% q$ L# x# @3 M( x% z, D4 K
   debugstr.draw
. u/ e8 k1 i: d. n0 RSet debugstr = Nothing
' R( Z9 T0 m% A6 T3 l' G" u$ E* [%&gt; </P>6 z. {/ L% a/ v+ T/ G* a" r8 A
<>=================================================== </P>
8 X; t! r5 y4 H0 H+ P. Y<>debuggingConsole.asp </P>. o5 O' G) O& |
<>&lt;%
, k$ L/ d' e4 b! N; k$ dClass debuggingConsole </P>' U. H$ ^! U/ u. F
<>   private dbg_Enabled + D' y3 d' C0 }+ L  U& K  h- v+ Q
   private dbg_Show
) [7 a- K. F* B6 b  Z   private dbg_RequestTime 0 P. e7 o1 F0 {  C/ h, W6 }/ a* P
   private dbg_FinishTime / H6 ~5 k  h) v" Z
   private dbg_Data
3 q( |5 M$ }4 G! V9 t. C8 V   private dbg_DB_Data
: ~4 X+ T3 ]; m) s6 x. V   private dbg_AllVars " `3 s' E9 L; o8 k& X
   private dbg_Show_default
( V9 T' `; h, u( ~' R   private DivSets(2)
+ W3 C2 C$ n6 V2 Z# j   
9 ~% `; D4 j5 R$ `# e" e/ a'Construktor =&gt; set the default values
; P2 X4 Q4 Z' Y. ZPrivate Sub Class_Initialize() 1 |+ O% g7 A( h5 ]) j1 ]- B( x3 K8 o
   dbg_RequestTime = Now()
6 r! V5 u/ g# `+ N. b1 {4 S   dbg_AllVars = false
1 A/ @; k. D( d0 X& |  c   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>$ ?. d1 f. t5 M/ z2 D; w8 m  y
<>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>1 ]  I( K4 l1 d) U: i$ W/ U
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;( A( K1 z4 U1 ~- R) L/ ]6 z- a7 |9 x
&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>
; T( m9 g  r" u: Z+ b<>   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>
6 R( E) ?' O0 y<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" & j+ E6 M& b9 l8 R
End Sub </P>
( J3 F) c5 p) T! ^<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
- Z3 Y1 B3 e% R& B/ s   dbg_Enabled = bNewValue ; V3 d% A% M- l, ]3 g' J
End Property </P>
$ }4 C0 Q. k! g! S! [6 s) c7 t<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
4 g% w) G$ X8 c1 t+ r; i$ r3 K   Enabled = dbg_Enabled
# E& O' a5 y9 v' UEnd Property </P>
  h) e) `( j8 O+ V2 f" m<>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 4 `3 I  x9 }9 ^6 t
   dbg_Show = bNewValue
" {* o* w, S& H  P4 B( cEnd Property </P>
" i& @; H$ J9 x6 ^6 _<>ublic Property Get Show ''[string] Gets the debugging panel.
4 P; A: R' ^; l1 Z; C4 A( O   Show = dbg_Show
0 s3 o+ l6 G+ j% H& R5 i3 `: dEnd Property </P>
* e8 @  A* Z7 c5 m5 h- h<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
8 X# b; \# [! G1 F   dbg_AllVars = bNewValue + ~$ ~2 Q+ N5 R; l/ o2 t' k5 Y
End Property </P>: Q) G2 w/ `4 x) X$ s2 z" Z$ R; V
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. 2 r3 _1 l# Q+ T' S
   AllVars = dbg_AllVars
. E  Y9 s4 S" n; y9 ZEnd Property </P>5 P+ H1 ?& C9 _3 X
<>'***********************************************************
( {6 f. E2 W5 g$ L$ \''@SDESCRIPTION: Adds a variable to the debug-informations.
' b% d7 q4 ]/ I6 I% P0 G''@PARAM:  - label [string]: Description of the variable
  T2 T  @/ Q* E# G/ e''@PARAM:  - output [variable]: The variable itself
) N; K: }, w+ j# P; O- P) D; M% `'***********************************************************
* t3 F( I2 D+ F- H0 Z, EPublic Sub Print(label, output)
5 R8 H) h- p1 F# W5 M% t" i/ |   If dbg_Enabled Then
3 ?* @7 U; G) j0 d6 u, O# W7 B' X     if err.number &gt; 0 then
9 K% S0 [4 i+ e3 j0 r       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) % M% j8 G7 L- H: W
       err.Clear
0 D8 ?. D" Q6 X  R     else
, v0 \7 x- N; A1 @7 \       uniqueID = ValidLabel(label)
+ {1 W6 o* E9 G- H, v       response.write uniqueID
# ~9 c3 C7 l  ?, _" j$ y" Y* W       call dbg_Data.Add(uniqueID, output)
* x' t  t% s# K9 V     end if ! Z! x  Z! v' d$ E- Z& N" X  [
   End If
9 h0 }3 q6 ~4 G1 V2 YEnd Sub - e/ W% S! X! s0 N3 W
  & F2 ?8 U9 m! H$ z% y7 D; t
'***********************************************************
# n) ?# ^3 a, U'* ValidLabel
' A1 {" Y& p) d'***********************************************************
6 |0 |7 T: _' ]Private Function ValidLabel(byval label) 7 |+ ~. A3 g' ?6 _
   dim i, lbl
0 \8 c3 |% w5 y8 }" x( z0 B   i = 0 7 a& z/ |0 e1 J" A% J' z
   lbl = label
8 S3 o4 I% Q0 A1 x) r& o   do
+ J' z$ F9 @0 z$ w   if not dbg_Data.Exists(lbl) then exit do 4 C8 X1 S# J9 Z9 q7 J
   i = i + 1
' {4 G* a9 s0 \( C   lbl = label &amp; "(" &amp; i &amp; ")" & @. H9 E/ z0 i( Q/ \* k/ b0 C( S
   loop until i = i 3 A/ g7 t, m" k; O: A
  * G, E7 i/ q0 U9 z2 y% Z& M
   ValidLabel = lbl   }4 m; u7 K0 Z+ D
End Function 7 o! \* G7 D) f/ h6 ]
  
/ i* n5 ?+ j0 a( t1 `1 ]: O'*********************************************************** " ^( o* f' @- S
'* PrintCookiesInfo ) q5 o* F# {# g4 e# `  E
'*********************************************************** ! l3 B! r! b1 n9 [# @' c4 j$ T& [
Private Sub PrintCookiesInfo(byval DivSetNo)
& m! Q  m1 c- @( I: C   dim tbl, cookie, key, tmp * o3 K% @6 }4 |' {
   For Each cookie in Request.Cookies , m( u0 G& D! G' R: K  F$ Y
   If Not Request.Cookies(cookie).HasKeys Then
8 z/ O. B4 A( V, R: w& I# f2 F8 \     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   # I$ C  l; C. e# h1 Q
   Else , D: _, P8 p# _$ W" a5 D2 {6 J& i
     For Each key in Request.Cookies(cookie)
& W" W5 {) ~8 y( Q9 Z     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
1 l7 K( C5 m8 W& iCookies(cookie)(key))   
1 Z. \* ]% F2 E6 _4 Y. F" t' L   Next 5 @, R$ O8 U1 ^! y& W
   End If 4 U; j: v; ^( U
   Next </P>
$ [" j& ^3 t1 [8 z+ s) h<>   tbl = MakeTable(tbl) # b4 m& D: v& q$ Y9 I3 l
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 ( ?: ^0 I& q4 C8 j/ l
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 3 ?4 S  _/ v: l  K' U0 }; [! `
   Response.Write replace(tmp,"|", vbcrlf) : J( o" N# d& ]* H& p% I. {
end sub
6 K/ v- h+ J: Z) v" r, k6 ^1 _( ?  
% Y4 H* q' z. a4 ]  m7 C5 l, I6 O- m'***********************************************************
- |/ j/ S) f/ g% |- w'* PrintSummaryInfo
1 U0 ]$ i2 ^! p# n'*********************************************************** ' T0 d/ Y8 {, F" ^) _' {( w
Private Sub PrintSummaryInfo(byval DivSetNo)
2 ]6 G6 K0 C0 a/ n$ `   dim tmp, tbl " {/ k3 S% u0 F
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 3 T/ f6 }& ~3 b4 O; [
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
! s$ K: O, y7 i8 j- v! c* G7 `" |   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
4 g. f2 r8 V6 S/ t, u   tbl = AddRow(tbl, "Status Code",Response.Status)
. A4 z: {: ^1 C6 h6 u$ I   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) " w1 O% I( z! h" {) k+ Y
   tbl = MakeTable(tbl)
! i3 V. B2 }# z, y4 F  F9 b$ y8 s   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ! ~4 _8 K" j% q- y; w1 d; B/ v" b5 L
   Response.Write replace(tmp,"|", vbcrlf)
) _  n) F8 ~& |) X  q' n3 z! L6 REnd Sub </P>
9 T2 f( D' m0 ?6 M5 [. _<>'*********************************************************** 1 Z! e9 l; }6 Q" I+ a5 {& S
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 4 M* N4 j* x3 x/ {: }
''@PARAM:  - oSQLDB [object]: connection-object
3 `9 n) \6 X8 ~# X" H: k: n/ l'*********************************************************** 5 Z( b- w& z$ V" J( [4 X
Public Sub GrabDatabaseInfo(byval oSQLDB)
! k6 t0 m$ R3 ^' S7 n# h   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) & }2 m  I8 H3 I& h' {5 @
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
9 D4 ^- t# O) 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"))
2 @3 L6 `- R( P/ M2 q$ r   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
& A4 @  u) F; v' N, SEnd Sub <>'***********************************************************
* y  I6 V2 A5 R  }+ F'* PrintDatabaseInfo
: I( J+ A! N1 ^'***********************************************************
9 j% {' U0 m. q- @$ y- i4 ~Private Sub PrintDatabaseInfo(byval DivSetNo) 9 n( h$ M! Z* T+ f
   dim tbl # S! `0 ^' S3 Q3 S- U9 Z2 }
   tbl = MakeTable(dbg_DB_Data) 1 U& Z( y/ c9 d2 j/ W
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
3 I$ x/ Z+ O9 H! x/ P9 w: l   Response.Write replace(tbl,"|", vbcrlf)
! S# d% H% Z3 zEnd Sub </P><>'***********************************************************
1 y0 ^& B& }/ n0 E% X9 l+ U'* PrintCollection
1 R. v5 o* j! R'*********************************************************** 3 c8 U7 |8 [9 o5 g, z1 o9 x
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) + r* {  }/ N, I( M+ C
   Dim vItem, tbl, Temp
' L, T6 G, a, j  ~% j, N   For Each vItem In Collection : ]7 T# t6 h0 E, }0 C# g  @
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ! Z7 Q7 n7 g4 `' h! d3 \
       tbl = AddRow(tbl, vItem, "{object}")
9 X0 v0 U6 }: }3 N0 A     elseif isnull(Collection(vItem)) then " v9 |3 Z" Q1 C2 c
       tbl = AddRow(tbl, vItem, "{null}") % R: ^8 `/ ~9 q: `
     elseif isarray(Collection(vItem)) then , \' F' d' F. ^2 k" n# U
       tbl = AddRow(tbl, vItem, "{array}") % M' ^3 M! A3 R
     else * ]3 Y8 o7 h! l, d! h8 |9 r
       if dbg_AllVars then
: d* o0 v* }3 _       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
6 s1 D! J7 r- o: S7 G     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
+ I" E: O: y! ^2 |       if Collection(vItem) &lt;&gt; "" then
6 @- e! H' U9 x, O2 f       tbl = AddRow(tbl, vItem, server.HTML
6 D5 u) x1 |. [7 a8 T' i! lEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") ' C' N) l, c' E
       else , r6 x. G2 K% }/ `& v/ s9 a; J7 Z
       tbl = AddRow(tbl, vItem, "...")
$ s+ V2 g0 c7 `/ f' ~       end if # }& Q/ F$ r0 Q& w
     end if . g& e+ w; U$ P5 |2 k* E
   end if 3 e& U/ v- l$ }- `/ I# K) A' C
   Next ( _/ g* ]6 M( b. V" p/ Y7 ]
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
2 ~9 v8 C" W0 p3 R* @   tbl = MakeTable(tbl)
7 _- Z! U: E. i( q4 }5 M! E   if Collection.count &lt;= 0 then DivSetNo =2 + t- @5 o- J3 n. e' f
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ! k1 R' G0 D0 j6 h/ K+ T
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) ( i  x+ _: o( h( ]# f+ M1 r1 R
     Response.Write replace(tbl,"|", vbcrlf)
7 Q9 H1 s0 x) P: u/ X( A. n, _5 uEnd Sub
7 G4 W5 V6 Y0 X; R7 T( Z  
1 n& U; }9 H( n: {( i" o) z9 @# }'*********************************************************** . P6 s' m$ ^0 d
'* AddRow
" [- ?1 n0 Z5 h  M'*********************************************************** % P, W9 m7 c5 u) M
Private Function AddRow(byval t, byval var, byval val) : r' y% M" q* g( E* r1 S
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
. `3 L3 F3 K. ~: L" R   AddRow = t . m5 |; G2 \; ~( F! e: t0 c, ~! Z
End Function </P><>'***********************************************************
3 `: }, Z7 f6 @1 @- {8 k0 S1 |# o'* MakeTable
4 |. o  T" T( r( ^- b, b( Y& e: o'*********************************************************** $ Z- v2 h3 `9 z+ b
Private Function MakeTable(byval tdata)
7 J# s  g: M1 g3 ~/ W( r   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
& i2 A) M9 E2 u4 `$ O0 h/ u' _   MakeTable = tdata * D( F$ G5 y" O" O$ J6 c: N
End Function </P><>'***********************************************************
+ ^1 E% N1 H+ D% e3 U1 g) X5 }''@SDESCRIPTION: Draws the Debug-panel
! g1 U) Z9 w8 U# m4 ?# ^2 b* p'*********************************************************** 6 Y: N; `6 {! Q) B) z1 ]' i
Public Sub draw()   T9 W1 i) h8 o$ W% l+ k
   If dbg_Enabled Then
( d0 j# d6 h% q     dbg_FinishTime = Now()
+ T1 l( w2 \) f( ]  6 y& a* l0 w0 F0 w
   Dim DivSet, x
; {; J* H: U# u   DivSet = split(dbg_Show_default,",")
) s7 f  {$ A8 x' h1 Q( l4 r, C7 Z1 \     dbg_Show = split(dbg_Show,",") 6 R, ~9 b7 I& W$ q5 z6 w( b. o" O
  
4 y2 f3 G0 `; t' S) L0 C   For x = 0 to ubound(dbg_Show) " _) W7 d4 I3 E7 ?
     divSet(x) = dbg_Show(x) 9 k' S  Z& K! E) M9 s% S( j% ?
   Next
: @. S  B' y& }$ N1 n1 D  ; A! E: v5 c! N  \& i
   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;" . v8 l- |1 m; P
   Call PrintSummaryInfo(divSet(0)) ! V. W( G! Z  p: c) L
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
8 X" E) n9 G/ a& A! q    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
# j7 ]* J: k. ^9 E( t    Call PrintCollection("FORM", Request.Form(),divSet(3),"") + O5 [; U+ ^- G  D8 U, i; P
    Call PrintCookiesInfo(divSet(4)) 0 i( v: R  p7 Q0 V/ @1 g
    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)) - `: b9 f, ?; G: u
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
7 Q" \6 f2 u3 v& y& z) n, r    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
) v5 u7 {0 c! \$ J2 X    Call PrintDatabaseInfo(divSet(8))
1 s: N( u! |3 Y/ V( S, d& o    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
/ X( W, w  d3 X; z    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") $ W: Z0 E4 `' M; ^
    Response.Write "&lt;/Table&gt;" % _( q) ^( m- P2 ^
   End If
3 x9 j) b7 P. LEnd Sub </P><>'Destructor
4 g. V+ Y6 j2 cPrivate Sub Class_Terminate()
3 V: I6 [; Z8 ^( N2 ~: S   Set dbg_Data = Nothing   P; p. h' ~+ p5 [2 ]" U& P# C5 w
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
5 b) A( O/ i0 U* y  X4 u- DCLASS debuggingConsole 7 L" n4 c5 C/ B: ~: @* ?
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
' Z" \. @0 p, @0 F2 z2 v& ^&amp;n9 K5 E: F1 `- W
bsp; # E8 F3 s5 {3 z/ A) m
Property Get Enabled===[bool] Gets the "enabled" value
, Y, Q$ Q7 W$ \# ^9 U4 ?4 z; T  3 I" U- f/ b) I% d% \* 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
7 r  V, i* [1 e& V  [  : c1 b2 q" x3 V( N; K
Property Get Show===[string] Gets the debugging panel.
8 y" d' c; F1 q1 T5 C# S  6 M' O) c  Y  F
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><>--------------------------------------------------------------------------------
  k3 B; e$ Q' `( d; ~, kPublic Methods </P><>public sub===Print (label, output) 7 ^& `9 D( K1 G) Y/ ]( Y
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) : B7 [; ~5 y5 [- u. k& A3 Z, G
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () ) Q  J6 Z) Y  M& R$ L
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ' q- n" p( h) @/ U% q) y4 h! a
Methods Detail ) V) w0 ]% S; P; u  ~
  
% ]! Z3 X. M4 [: vpublic sub===Print (label, output) ) G) G' k% ?* x# C7 D) q
Parameters:  
& O  N* O+ \0 P" N+ e% g   - label [string]: Description of the variable
: J' L$ O3 D( i0 x6 l! I$ o1 z   - output [variable]: The variable itself
5 z& L* C) }. E" l  
& X( ?$ c! c# Ipublic sub===GrabDatabaseInfo (byval oSQLDB) 0 j: L) m/ }: s8 A
Parameters:  8 R6 X$ P+ A+ y4 n) ?
   - 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-12 13:44 , Processed in 0.353804 second(s), 57 queries .

回顶部