QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
/ L3 |* b7 w6 s<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
+ u+ c3 [6 j8 k使用方法很简单:
+ R, I: @/ |) I- Ftest.asp </P>; d+ O  f3 |3 A) T
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
" y/ Y0 K7 c0 k5 M7 h$ j&lt;%
; m4 E( v* ~1 V3 N: Y+ m0 z5 m. doutput="XXXX" 4 ?! @4 X4 E. N2 y% r2 i8 n9 n
Set debugstr = New debuggingConsole
9 A$ Y7 O* p) m' p4 H4 Xdebugstr.Enabled = true
/ [" e$ U, s0 x  U; p8 K   debugstr.Print "参数output的值", output ! W# ]2 x, x1 Y3 W, B3 K
   '……
' d9 }% X) p9 O( r- N9 f   debugstr.draw
+ R1 }( M" E6 h: m* l0 K. J' rSet debugstr = Nothing
1 ~# \5 h( }' t& A6 s; `2 v. |: K%&gt; </P>
; ?( I/ S: E5 `( ~/ z3 }<>=================================================== </P>+ T8 o" I( s( k8 U
<>debuggingConsole.asp </P># r0 M9 O+ U% F7 R. u- L: H
<>&lt;%
% b  i" J) O9 uClass debuggingConsole </P>
7 M; ?* b, J& y<>   private dbg_Enabled $ ~7 \0 z- U2 B( m" s4 A! Q2 A; A2 {7 X
   private dbg_Show 4 m( F5 M3 U1 ^  b3 z% u  U  V
   private dbg_RequestTime
5 ^$ j8 B8 ~6 u( Q9 U  r- n% A   private dbg_FinishTime
5 V' c! s+ j: m5 }1 L   private dbg_Data - Y5 n" @  I. f( Z' O- M
   private dbg_DB_Data
! K, ?$ [4 q% R: K' a5 l+ n" c9 R. F: y   private dbg_AllVars $ j6 A- Y. i/ v; I/ O; O
   private dbg_Show_default
5 y5 {1 x" w1 S* l- i6 O, b! ?   private DivSets(2) 9 T5 E. e2 g: P" a& K
   
) ~8 E  C# b/ \+ q" p'Construktor =&gt; set the default values
; I% d% U& |/ Z2 A0 Y  dPrivate Sub Class_Initialize() 1 y* r6 u. n  u" f, \1 [% x# O
   dbg_RequestTime = Now() $ R) W" M6 h2 a+ @6 k& ?7 {
   dbg_AllVars = false + T5 l1 C6 J$ e% ~5 g! O8 c
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
0 H  @0 `# s; }' S# k4 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>) e5 X9 W5 Z/ P4 J
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
4 G0 g5 B" @' V" r1 y&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>9 ]  a9 n( s1 X$ q
<>   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>
/ _/ \  C2 U) S) G0 ]0 }<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
' G0 j6 i5 K1 jEnd Sub </P>
2 G# i, i5 F/ D. ^<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false & i/ n+ O$ ?* H
   dbg_Enabled = bNewValue ! s( Z/ w% g* p0 X" _' m
End Property </P>
) M+ X  F* E' ?0 _<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
6 g7 e" p! B7 [* U! V% Y   Enabled = dbg_Enabled
6 H( h2 [$ E5 E. c' V4 Y& fEnd Property </P>
& n& i2 H# U8 d<>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
$ m3 y# }) B1 [3 E   dbg_Show = bNewValue
% J" B9 r6 n6 E8 t% yEnd Property </P>/ C: ?6 u3 T5 ]1 ]1 x) Y9 W9 I
<>ublic Property Get Show ''[string] Gets the debugging panel. - B1 s$ V+ N- r: }, @3 p: D
   Show = dbg_Show
3 z- J: o0 ]$ T. l% aEnd Property </P>5 c" \" a. b" b5 \7 t9 {
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ) U0 z( O/ o% o' ?! H
   dbg_AllVars = bNewValue ( ]9 q5 b8 N# S/ ~* e& P
End Property </P>
0 Y, W" a0 U  w# t- {<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
  I) E9 A. ]% A9 m   AllVars = dbg_AllVars
- l0 b2 C8 F$ ~4 b8 ^; [' m' f5 tEnd Property </P>9 v/ r( B5 S; q% w  Y# h0 |
<>'*********************************************************** + G+ L4 a* c2 R* z+ K3 X4 P1 e; t
''@SDESCRIPTION: Adds a variable to the debug-informations.
! \, t8 O' O( O''@PARAM:  - label [string]: Description of the variable
# L; {4 O% x* |) k8 A2 W, `''@PARAM:  - output [variable]: The variable itself / X; t4 ]% Y5 O* o  Q$ ^  A9 s
'***********************************************************
# V9 w3 f0 ?2 c+ v0 ~9 D% pPublic Sub Print(label, output) / J- w  I1 d) ^9 H
   If dbg_Enabled Then
+ k7 W  T& a* h5 e" G; C3 U     if err.number &gt; 0 then 8 H% Y1 e# }1 K3 T0 }# J
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
6 h0 e9 c& v6 I       err.Clear
1 e+ W4 y  I3 ~( U     else
  h! O' _: a& [# h       uniqueID = ValidLabel(label)
+ }* Z* g+ ]4 [6 \# m0 Z       response.write uniqueID & M! {+ a. z/ V, X
       call dbg_Data.Add(uniqueID, output)
4 [0 F  d+ b2 J2 S8 r; Z  U2 u     end if ) W& t: p+ u9 z* f9 A: z( L
   End If ) B! h" J9 x" r, v# q& c
End Sub
$ E5 i. A: D7 _8 o& d8 G$ |" A  
, a; b# y/ Y* O8 P3 U'***********************************************************
' u3 |' M: w! K5 W  d'* ValidLabel ) `5 H; z0 Q  X. k. O/ F( C
'*********************************************************** & o  _- y1 E  y$ F
Private Function ValidLabel(byval label) & S& Q& E) v- ^' R5 _( g
   dim i, lbl 2 N; f$ Q& F2 l! _% v( ~
   i = 0 5 b  \/ _$ T3 |5 l. @/ ]
   lbl = label 5 o. {! g* ?, c+ r0 Z
   do
  J9 a' U# P8 m# ?   if not dbg_Data.Exists(lbl) then exit do ' w" E: k2 m8 Z& U, P9 `
   i = i + 1 - P/ d# X$ Z/ Q2 ^8 u3 m+ _  D
   lbl = label &amp; "(" &amp; i &amp; ")"
, g7 l, _& C8 {/ A5 \   loop until i = i
. p/ t; k& o+ ^  k  
- d) F) v, _$ x$ a# r   ValidLabel = lbl
. F9 [1 I& E( x5 ]. t. u1 B6 a5 iEnd Function
5 O+ @. a6 O( o& L- ~+ z- ~  # o6 O! y% n; z3 v9 \
'*********************************************************** 5 M6 h5 ]! a. J9 |1 s5 F
'* PrintCookiesInfo
3 c2 b: P* K% X; ['***********************************************************
, `0 w1 r+ A, {+ H: E7 zPrivate Sub PrintCookiesInfo(byval DivSetNo)
, |5 R2 }, V: E! U) A) t, c5 u6 {% j   dim tbl, cookie, key, tmp / f4 {0 v; {2 p7 L* t
   For Each cookie in Request.Cookies . v8 \& z& ?: v% o& n9 ]
   If Not Request.Cookies(cookie).HasKeys Then
, y( _# o5 A! P* \3 @( E     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   # t5 f* Y: \: x5 O7 @9 K4 q
   Else   f+ h2 a5 K4 f6 K
     For Each key in Request.Cookies(cookie)
; a/ A; K, b- h     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. / Z0 V" q0 t* E9 c2 j( G
Cookies(cookie)(key))   
) `+ J8 o. o* i* a/ z* B   Next   g. C& {' G/ P# N5 Y4 _
   End If + n3 O% F  N( \" m9 T( J
   Next </P>5 y, F/ x7 o) N
<>   tbl = MakeTable(tbl) 3 E$ }: Z" }* z$ {" Z- R  s
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
% a0 a/ M1 I1 V5 A   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 3 a; X6 P# s- b3 h
   Response.Write replace(tmp,"|", vbcrlf) 2 x8 \: o, m- l* a
end sub , c; T1 i+ N0 B  |9 ~# P
  
2 j% N  A2 Q! e) y5 K'***********************************************************
' z( G& ~' b7 ~* }+ X'* PrintSummaryInfo
9 ]  b1 [4 ]2 O+ y+ r  G5 }'*********************************************************** 2 ?& x( C2 ^  s  \6 n: Q4 F
Private Sub PrintSummaryInfo(byval DivSetNo) * a+ ~* t/ y1 K4 Z! A! c" h3 a
   dim tmp, tbl 5 j! u. w, D" H9 }; \$ b/ N
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
8 ]% f2 p  ~! }8 w' f$ y, c+ C   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") ! J- j; J+ _4 p7 I- P. u
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 7 R" O2 I1 p( K# g
   tbl = AddRow(tbl, "Status Code",Response.Status)
( O4 c8 @* ~/ C; J/ X; ~: M   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) - g& b  s' Y! c  r4 ?4 q
   tbl = MakeTable(tbl)
- B9 t/ H8 m8 V5 E   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) / L: J/ R, H4 z) G
   Response.Write replace(tmp,"|", vbcrlf)
- }& _1 ~9 M, X2 h+ \+ }& yEnd Sub </P>
1 Q4 r- ]& B5 I5 G$ w+ s4 ?<>'*********************************************************** ' b6 j8 @  w+ `! e  W4 P# V! C
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
; b2 U: t/ T: N; T! \7 P''@PARAM:  - oSQLDB [object]: connection-object - B, O0 @5 D' I0 h5 |* Q% W
'***********************************************************
; ?9 s% t  w! \  S* E% S2 [Public Sub GrabDatabaseInfo(byval oSQLDB) + D( v& y) f1 i( U$ q
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
+ }' Q5 C& E+ Z, k6 @   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 1 `/ r1 Z; n, |# h" G5 `; R- l
   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"))
7 x5 o6 u' ?6 r" z. x/ p   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
4 [& f6 p9 n) H9 pEnd Sub <>'***********************************************************
/ C) u+ L! o- F* l'* PrintDatabaseInfo
3 z: U7 Q+ r8 V'***********************************************************
' h  I* U. ]( M% o0 g8 P+ `5 R9 ]Private Sub PrintDatabaseInfo(byval DivSetNo) ! ]$ T1 {/ F" G5 \* \
   dim tbl
: v8 F. z/ x; F. o- [. i; C   tbl = MakeTable(dbg_DB_Data) * Y2 g3 C' f) U
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
* P- n$ l9 O; w, {+ {6 Z. q   Response.Write replace(tbl,"|", vbcrlf) 1 {6 G' s4 {0 e/ C* J- i" j$ U
End Sub </P><>'*********************************************************** , l; g, E8 A, R3 a4 v
'* PrintCollection
5 [, e4 |8 c# [& X- {% ]  S" T'*********************************************************** - X. H# |4 x2 f2 w
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
4 N2 l& y% Q, \, F- G6 X9 s   Dim vItem, tbl, Temp
2 y8 l, s) U; F; l1 L7 |9 a2 g   For Each vItem In Collection
- V+ u& ^- X- N& u# q     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
/ N, w7 c' {' t2 _       tbl = AddRow(tbl, vItem, "{object}") & r! C1 q! G+ {; Q; O
     elseif isnull(Collection(vItem)) then
2 Q! j2 u/ h! E% o1 v/ i  j       tbl = AddRow(tbl, vItem, "{null}")
$ S3 G0 G9 E: l3 q6 O     elseif isarray(Collection(vItem)) then
7 B) L' x3 }. [% g7 M6 T9 [       tbl = AddRow(tbl, vItem, "{array}")
$ P6 O' q4 U* K0 ?) q$ H( u     else * G" \* K# l5 o' k# T7 q
       if dbg_AllVars then ' q. c3 \+ W1 v2 Q* B
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) & K$ a3 c- u0 Y3 ~6 c
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then ! {  ^# m4 R4 W) G, O$ Z4 \6 {
       if Collection(vItem) &lt;&gt; "" then
% S( d! E4 }3 q1 y       tbl = AddRow(tbl, vItem, server.HTML& [6 `5 s1 N# \2 Z) W
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 8 w+ l  V' v% ]" ]1 w
       else ' q' ^( O4 v% c& I. E
       tbl = AddRow(tbl, vItem, "...")
0 L' c' n* _. R, z1 [       end if
+ w" a" i5 X# Z     end if
+ Y% y* S7 E% O. c/ s) c! k   end if ; z( y+ L6 L3 h, Y' f6 T
   Next
) _+ f4 t7 n1 n! W: e   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
4 T2 {  ~# z! Z3 f0 m   tbl = MakeTable(tbl)
7 n( o/ F3 k* E! {" B$ }! E9 B   if Collection.count &lt;= 0 then DivSetNo =2 ( x4 A( T) o8 c+ B; M! u; ^
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
- `. {4 D" K* u2 w     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
8 Y' f& e5 V! F2 l- _# M' e     Response.Write replace(tbl,"|", vbcrlf) + l, ]5 ]6 h. b: x; S
End Sub - ], T' T4 J) g4 Y: [( F) `. A
    D- ]: Z5 k$ f7 _/ I
'***********************************************************
9 {  }% h: S9 [7 {  x'* AddRow
. J5 O+ A% _0 `( l& Q  d+ Z/ L'***********************************************************
% L- H0 t, \/ c) K) _. f3 T& CPrivate Function AddRow(byval t, byval var, byval val)
) L  c: S+ f& Z' n# G- W   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
. k5 ~' _' b" d5 ~0 M0 N2 _- E   AddRow = t
6 N; t& y* _1 }; gEnd Function </P><>'*********************************************************** & q9 L# H( v7 B
'* MakeTable
' o* r0 p: g( ]$ O5 S'*********************************************************** / [6 z- X. u: r6 H0 q
Private Function MakeTable(byval tdata)
1 Q& P( x" D8 v# x5 b0 T+ _- S   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" ) A' Q6 m: M# Q0 G
   MakeTable = tdata
' t$ I0 f% g& M6 j* t& u7 J$ S( bEnd Function </P><>'*********************************************************** ( p% G3 Q- x3 {6 g
''@SDESCRIPTION: Draws the Debug-panel
! @) ^( D4 {& Q# v) x$ e'***********************************************************
' z/ g6 R6 L$ w8 Q0 S( oPublic Sub draw() ' {, O8 b; d7 m$ r8 z
   If dbg_Enabled Then   ~7 x* a* ~- x. j" L: w% `
     dbg_FinishTime = Now()
3 Y' I' ]2 Q5 @  * B0 I8 r# `4 u6 u. R6 T
   Dim DivSet, x
1 R- W  H2 p, w0 K' p: X   DivSet = split(dbg_Show_default,",") 1 P  z0 N1 k) l. |' n
     dbg_Show = split(dbg_Show,",")
$ Y8 W/ {+ A% f8 j9 R& P  
" C8 \5 v2 g* W6 k& ?9 K7 b/ i" z   For x = 0 to ubound(dbg_Show)
- ]- N8 E+ H4 S  G/ a. `7 o7 V     divSet(x) = dbg_Show(x)
' g. U, Y0 f/ {3 j0 o, [) c/ e   Next
1 R' ~  A/ d# |6 z/ [# p6 W* h  / _# r9 o6 b- i# X  D% y
   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;" ; m3 A5 S4 F$ V0 _0 b) O
   Call PrintSummaryInfo(divSet(0))
* f5 c" S9 p4 V. [/ ?+ r! ~- E     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
5 Y8 l8 f7 X, |3 o/ L- t; n    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 9 q8 @& k2 `+ q7 P# N8 L( M$ [
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
, e; C% I$ d, e5 Y# Y8 p    Call PrintCookiesInfo(divSet(4))
4 |+ b7 X) D7 o) p; m: _6 K" f% h    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)) 4 [: k* t: U* i
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
9 ]& k& V- \/ K9 l7 K$ ^/ N    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) : {% z; [) `1 F! `) Y0 N* ?% B- @
    Call PrintDatabaseInfo(divSet(8)) $ U: v+ U3 O: O4 S! p7 x
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 5 }' ^/ u, G) |/ w1 a. m
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 9 l2 O+ U9 }; B
    Response.Write "&lt;/Table&gt;"
! t/ h( u; u6 r  k. Q8 u' I   End If - i# a' H) M; o7 y
End Sub </P><>'Destructor
0 v- m1 H5 `! H+ @) R8 W. v6 VPrivate Sub Class_Terminate() + K& y% r7 n( n; |
   Set dbg_Data = Nothing
2 b0 q# W8 ^, H3 {8 W% r& ~End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>' U/ ]/ Q7 O- a: ]
CLASS debuggingConsole ( k1 M0 `- Y4 b' R% C/ X, q
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
! u% j; ^1 x' W+ t, O4 z! R&amp;n
8 L& h; x. E& H% r( E; G7 {bsp;
+ D6 b4 u1 E7 r$ f$ y) ?& bProperty Get Enabled===[bool] Gets the "enabled" value
8 M/ [% |# u9 I9 N; `8 s$ L  % _( T. \9 B. k! `; M- f* L
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 * y- Z9 H" h4 v% `3 l( K
  
" b4 d/ {. A# x  e7 ?9 `- `  |6 x: pProperty Get Show===[string] Gets the debugging panel.   l2 X/ E; e: |8 P4 i
  
: Z% ~% Q2 ]! i# P2 F" F2 FProperty 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><>-------------------------------------------------------------------------------- - _* @6 w- L- {, O5 O) e
Public Methods </P><>public sub===Print (label, output) / ^* Q# {( j, c+ H7 e+ C
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
+ @0 n2 j* _, t( ?7 Q* J   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
+ V9 f0 \, `4 m- H' L) w   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ) Y& @- }  i! n+ l' D& k
Methods Detail
. M2 P; S8 l& ]4 {5 E  
7 I- S$ U% a6 C3 p% _/ L2 tpublic sub===Print (label, output)
2 b' Y" c- v4 [: R6 iParameters:  # Q" k" y7 X+ D- i, G
   - label [string]: Description of the variable
: t. `8 p3 w8 S% c2 Z, C   - output [variable]: The variable itself - [7 \) f8 w  {0 M' B- U& h) ^
  
! a, G$ W1 U* Q/ W. O' `public sub===GrabDatabaseInfo (byval oSQLDB)
; |3 O& S  l5 c! M" m. j' sParameters:  
5 o( E! ~# h+ A& M   - oSQLDB [object]: connection-object</P>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册地址

fastpost qq
收缩
  • 电话咨询

  • 04714969085

关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

手机版|Archiver| |繁體中文 手机客户端  

蒙公网安备 15010502000194号

Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

GMT+8, 2026-11-18 09:14 , Processed in 0.226590 second(s), 57 queries .

回顶部