QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>" Q0 D7 t9 v0 W" b2 W, K. Q/ e  l7 p
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ( w# L. l+ D9 i$ y
使用方法很简单:
9 }/ X- B- ~( T6 |test.asp </P>
* s- q+ T4 r5 K! D<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
$ m; e9 G3 ?" v. Q& F1 j: u8 T# k& T&lt;% 5 `6 i: G2 w" _; ~, o/ E
output="XXXX" * D" @; f# f  v' S; D7 C5 j( v0 x6 Z# ^
Set debugstr = New debuggingConsole
" ]( t- Q( ^3 L, ?. w6 \3 gdebugstr.Enabled = true 3 H) J3 v7 W/ Z
   debugstr.Print "参数output的值", output ; I# Y1 p, x: u- r9 j9 I! K( |
   '…… + \% c. z5 v9 H2 z: A
   debugstr.draw / P& r6 }% `. P7 T; d
Set debugstr = Nothing
" M2 Y+ z7 a( Y: t. v6 n%&gt; </P>8 T0 u  B3 T6 n3 Z, t* n; t
<>=================================================== </P>. A) R) \8 C; K" v5 a, ^
<>debuggingConsole.asp </P>. z2 I6 V  M6 q! _2 L, j+ C
<>&lt;% 4 X# C" Y$ @# [, H
Class debuggingConsole </P>& I, D! X: G; G1 b, ~
<>   private dbg_Enabled 3 Y" J! B9 F5 l" q) U9 n7 M) A9 s
   private dbg_Show $ v/ V! @9 l: I! [" y* V
   private dbg_RequestTime
: z0 m! U: H6 G) E& z   private dbg_FinishTime 2 ^2 S( {# y+ {8 G; `
   private dbg_Data - ^6 T. I7 S) [* K
   private dbg_DB_Data
7 D+ Q5 C$ ]& _- l   private dbg_AllVars
' t5 n# s4 Z* g3 w) R1 s. f( s   private dbg_Show_default
( r: [) o3 Y; @   private DivSets(2) & J* ~8 T* V. J; W8 t
   6 _  G# j! v6 ^5 K2 q8 }! h
'Construktor =&gt; set the default values
6 h. F- H! u: V" E: G5 N4 |Private Sub Class_Initialize() % d4 X8 E5 }: A; P" s
   dbg_RequestTime = Now() % ?2 e8 e4 y3 [+ q/ F
   dbg_AllVars = false
* t6 t3 H: P, Z% }" n1 C; W+ S4 j* |   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>8 u& K/ u9 B6 J# G. k5 o4 K. \) o
<>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>
) s* J9 t! m6 k5 }; [3 v+ ?) l9 j7 a& V* p<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
. V1 m4 B  O/ x" N$ v&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>& e; d, |+ I) {% n/ c0 o
<>   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>
; P( A. @3 s2 |5 C# F2 H3 A! n<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
0 U4 R* u5 V$ H8 W1 B& X; k5 SEnd Sub </P>0 y- y  R3 E, P- A, L
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false ; B% K: |" d% k5 p/ u
   dbg_Enabled = bNewValue 7 `7 o# r: [8 {+ N. W* @9 H/ Q
End Property </P>
9 A$ N" l7 j; c) f<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 6 i0 V% w' g( l7 B8 v6 Z, v
   Enabled = dbg_Enabled
# i8 B0 y7 u5 j, @" B$ v9 iEnd Property </P>4 W9 I5 X7 T/ a$ }
<>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
1 g* n( c: z6 f& F' B9 L   dbg_Show = bNewValue
  K4 _9 N% P( D5 S$ xEnd Property </P>
# j! e( [9 l' ?) g<>ublic Property Get Show ''[string] Gets the debugging panel. # K( z- f  q$ n$ R9 q3 H( r2 b
   Show = dbg_Show , L- A. x5 M  ]
End Property </P>
0 t8 l% m1 E; r' D+ `$ A' }<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
: K4 {( v" @. p. N, \$ G   dbg_AllVars = bNewValue ( M! |& f# L8 s
End Property </P>' ~; q# o6 E( n6 i
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. / t7 h1 B0 O( P6 O# p% r
   AllVars = dbg_AllVars - x9 @- c+ d6 |" }/ v+ e( Z
End Property </P>
- R5 q9 D. F9 a. F<>'*********************************************************** 0 J8 r% C* |- {' r8 B1 ]# s) _
''@SDESCRIPTION: Adds a variable to the debug-informations. ' Z7 i. `( O* R) }
''@PARAM:  - label [string]: Description of the variable
1 q+ u0 Z- ^( @1 u''@PARAM:  - output [variable]: The variable itself
; Z8 @1 p9 z3 K! }& U4 A'*********************************************************** 4 l# b4 V7 F: }' q7 F. S6 ~
Public Sub Print(label, output)
& T# |- v' j- K  q6 W$ l" ?   If dbg_Enabled Then
1 t) M& r$ w3 [2 m" i     if err.number &gt; 0 then
  y  V: b- p+ D2 |+ g& u- ^7 [3 Y       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) $ D* I! {6 k$ G4 Y
       err.Clear
( n9 R3 `$ R% `/ r     else
) P9 o' i9 L/ \1 Z' V       uniqueID = ValidLabel(label) 3 I# y9 i" @& p2 x3 S$ i7 b
       response.write uniqueID 2 k) A- U) q& q$ Q# H+ v( J
       call dbg_Data.Add(uniqueID, output)   P& G" E, L- [; v
     end if % l( K* C( }8 u% e+ H8 t/ N' u# ]
   End If
& f# v. b4 b+ {* C# k" TEnd Sub ( u2 v; Y! b: E5 ^. b6 G& H
  : g% L; v2 N( _& B6 W' {# v8 G- @) ]+ x+ d
'***********************************************************
. {0 K! \& q" v( H  T  |'* ValidLabel + q! s1 `1 N+ _* w! ], ^% K0 ^
'*********************************************************** * T3 G) Z) u4 S
Private Function ValidLabel(byval label)
1 k# [( d8 m6 I   dim i, lbl
' Z/ `  [6 l6 y3 g) s8 T( [9 ], N   i = 0
2 D( q8 h" y0 O3 Y; g+ w2 M+ k   lbl = label
. g# Q7 a8 X7 {; v   do
' `9 ?, v- R2 u- @   if not dbg_Data.Exists(lbl) then exit do
, K, F. S, m* x" y5 ?3 x   i = i + 1
. K2 O) E7 y1 B8 I5 f& N6 R   lbl = label &amp; "(" &amp; i &amp; ")"
$ E+ u2 _/ t/ \   loop until i = i ! @" H8 [! J6 @- e! n3 K: }) G) j) v
  
6 J/ j- @# q2 [8 y4 H! v5 x   ValidLabel = lbl
4 O, j' K/ s) q7 u' r, aEnd Function 8 C3 i" e1 Y# v3 l7 I& X
  
* c7 I' C4 u8 w$ d9 i% r7 j'*********************************************************** ! J1 c5 s! a$ z+ ^+ b; V& L
'* PrintCookiesInfo
# R0 r; q  E* x, c- V- p'***********************************************************
2 C6 _7 {) e" b/ O( q1 `  x3 XPrivate Sub PrintCookiesInfo(byval DivSetNo) % o3 h' @2 E8 n, Q/ W# p; X
   dim tbl, cookie, key, tmp
& z/ U/ c! b; J: x   For Each cookie in Request.Cookies - b& D& B( I* m5 I
   If Not Request.Cookies(cookie).HasKeys Then / x, U6 Q9 r3 S' r! M
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
* X( D, q! E- D1 t' X6 u   Else * h1 T9 @4 c5 L8 ]
     For Each key in Request.Cookies(cookie) & @7 p' l& D$ C- r2 [
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
, i$ O( q0 I+ d; T0 vCookies(cookie)(key))   4 T. Y( x$ o9 }3 L+ {) F, V& I0 \
   Next 0 W: o* ?1 _1 ^( j2 r& C" y2 U; {2 d
   End If 7 N7 I) U- s. `6 a! g; E
   Next </P>
/ i' u! X+ Y' S  u& v<>   tbl = MakeTable(tbl)
/ I0 D+ q+ s; j4 @8 \5 b- Y   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 . B( ~' r: B5 ^. m! R0 X9 I
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
* ]3 D% t; d" `# l) g3 J   Response.Write replace(tmp,"|", vbcrlf)
* d5 M% s$ D' K" G1 pend sub
" c1 g7 p5 u4 E  
$ E8 J. f- z3 H( d6 g2 Q1 Y5 L) x'***********************************************************
4 F$ i8 y5 }0 c3 f- A5 D, C# l& J'* PrintSummaryInfo + |3 y9 B6 g# |! v: G
'*********************************************************** ( f" @7 i+ @% F, }( |/ c
Private Sub PrintSummaryInfo(byval DivSetNo)
2 o) n, A; m# Z" B3 n) O/ h   dim tmp, tbl
( Y  u2 W9 Y' Z) q   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
. y4 r* Z  q7 J6 ~' m4 v; o, G   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
8 s* q! m4 D* ^" l& z. |   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
* i$ n  }0 {( H, j' S. i' e   tbl = AddRow(tbl, "Status Code",Response.Status) , v9 G: ?8 o( A: Y3 U: o+ Z6 ^) ~, f$ c! a3 O
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) ' W1 j* O" G3 Q- T$ G% T
   tbl = MakeTable(tbl) 3 e# K8 u6 i4 V# E1 i
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
" \! q0 d, G- Q) _( T   Response.Write replace(tmp,"|", vbcrlf) : i% Y# {1 p$ k1 B, T$ h' M9 T# w
End Sub </P>7 i  E1 j5 r) ?. j
<>'***********************************************************
4 ~7 ~; d9 l# Z8 z5 d''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 6 i) h4 v" [# B2 u
''@PARAM:  - oSQLDB [object]: connection-object * @8 ^9 P- K" D- K+ D
'*********************************************************** 6 |) R6 e; R+ W/ B3 W& C
Public Sub GrabDatabaseInfo(byval oSQLDB) + }2 V1 E3 t6 |7 ~
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
6 g% f* B9 G/ k( o. S9 k1 l   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
9 h& `; I  D: W- F, a" F  ^   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"))
; e6 f( `; \0 M0 M   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 2 S8 U. u6 C1 m3 ?. p
End Sub <>'***********************************************************
, [# Z# u5 K/ z0 x7 ^* h'* PrintDatabaseInfo
$ _8 @: u; B# [6 g/ A8 d  B'***********************************************************
: ~* p# P# R% jPrivate Sub PrintDatabaseInfo(byval DivSetNo)
2 x/ K( @# V5 U3 ~0 J& b   dim tbl
. J& ]/ s& F  E0 v' r5 o' {* H   tbl = MakeTable(dbg_DB_Data)
* S9 M+ k8 i, o# B3 B/ `: b$ T   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
6 B; U+ n( y! I' m( n   Response.Write replace(tbl,"|", vbcrlf) . M: r1 Z! {1 [# D6 G' T
End Sub </P><>'***********************************************************
* L! {0 a" D# P) i, O'* PrintCollection
0 B* A6 g7 r' Z+ G* X'***********************************************************
: p' R: F! p) {9 G% u( p7 sPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) - h% [: x# K" ]
   Dim vItem, tbl, Temp 1 Y) O. R3 {4 k' c8 C/ e
   For Each vItem In Collection ! C: C3 ^- k0 E
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
7 G" [9 M8 j  {' H       tbl = AddRow(tbl, vItem, "{object}")
  a7 f: w! i" H     elseif isnull(Collection(vItem)) then
' c+ X( }7 A' g       tbl = AddRow(tbl, vItem, "{null}")
  `5 |5 }& S. R6 K4 A6 k     elseif isarray(Collection(vItem)) then ' I% k8 h; V$ f4 r- Q
       tbl = AddRow(tbl, vItem, "{array}") & f; y% A/ O( ~3 X6 o
     else
; V/ e, O3 g( H% J7 C8 Y       if dbg_AllVars then " c* y+ s" H8 E5 n: J) _! S7 L
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 6 @, E, E' e$ ^8 H) D6 x$ E
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then . c( Y5 H( `& ?3 x8 e% x
       if Collection(vItem) &lt;&gt; "" then
! D; Q: l+ ~. E       tbl = AddRow(tbl, vItem, server.HTML+ \) D) v% g/ U# Y8 h1 K
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") : {: }7 Z4 C5 r' I8 \7 g/ Y
       else 4 E% d( J* e1 r* i) E1 v
       tbl = AddRow(tbl, vItem, "...") 5 x8 Q( W: L4 \( m& v; \* ]4 d
       end if
' T9 [  W' |" F     end if
6 J8 C" @. D" S! Y   end if 4 w) [7 w8 W1 u. [1 y
   Next
: v" ]5 \9 t/ f( _( B' b   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
  G$ _$ q5 z3 q! Y4 \9 R   tbl = MakeTable(tbl)
6 a1 k& ]$ a/ P3 m# ?   if Collection.count &lt;= 0 then DivSetNo =2
: f+ j6 X, n6 @$ K( D* U' ~     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
( ~4 U# [% N$ A6 g- v     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 4 m6 K; [" l% k1 o0 [* {1 B
     Response.Write replace(tbl,"|", vbcrlf) 5 T# J4 }( i7 y0 f
End Sub
$ j; i+ M" w1 `5 i/ C+ i- O$ q) m& E  
0 z( U4 @% v% z'***********************************************************
" d- P2 g7 g) n! L'* AddRow
& ?. g5 D4 m! t: q* l9 K- g'*********************************************************** - g9 H: {6 C5 |3 L( _, I" n: D
Private Function AddRow(byval t, byval var, byval val) . m! `5 z8 j1 B, D* T! X) t
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
8 H3 D) j4 M9 n! f& N; M5 r   AddRow = t
, F5 K/ l6 z/ R' UEnd Function </P><>'***********************************************************
' c5 r6 N: `7 v; d% p% j% {% M& g'* MakeTable % n9 B& Y1 y/ L& m. X3 n) D9 \
'*********************************************************** 6 T  }5 }! J7 m4 c( ?3 c+ z' P. h' W
Private Function MakeTable(byval tdata) 2 _* A  ~. Z* t% i- k7 G
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" ) A1 ~6 m7 Z9 @
   MakeTable = tdata
/ J( T, }' r3 v* j" Q% mEnd Function </P><>'*********************************************************** 5 F9 X# v; a+ F+ Q4 I
''@SDESCRIPTION: Draws the Debug-panel
: Z9 ]+ d5 d$ S: J% ['***********************************************************
+ A! v, r1 u, A8 b+ m% h$ mPublic Sub draw()   ~+ H$ W2 u, i+ N, J; m8 n
   If dbg_Enabled Then 7 q# J* v: N; c0 m7 N& @4 [
     dbg_FinishTime = Now()
4 H# \$ z5 C( F9 T6 ^& Z  
) R, r( p$ a# I& x( U8 d" O" ]% w   Dim DivSet, x
$ x4 F: r& m5 G- v* N* w6 ?   DivSet = split(dbg_Show_default,",")
/ @7 S" S/ g+ Z2 }# a     dbg_Show = split(dbg_Show,",") 9 }0 c( r/ A  ^& ^# U% w& y/ V
  
, u9 G" h+ _4 s   For x = 0 to ubound(dbg_Show) . _) {" G; y, m
     divSet(x) = dbg_Show(x)
$ \; o2 \3 y3 M2 R, f* p7 e   Next 6 q2 B  p& _  t5 P6 f
  
8 B2 C, d$ T+ `: a6 H( b   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;" $ Z/ I  Z: P4 j7 N0 P
   Call PrintSummaryInfo(divSet(0)) 0 ]" B# R* d' T1 v9 A. o
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 4 m" d) @5 ^6 @: I* j, x8 Y) I
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 1 @+ K, @) j' J! ^
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
8 s" _* ~- t4 N' D5 _9 |2 W" O    Call PrintCookiesInfo(divSet(4)) ; C; A' ]% |: Z. I, W4 Q* `; o# H" z* j
    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)) ( ~/ P& o) J! o; X) Y% w+ u0 S: g
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") : B6 d' {) I5 c
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 8 a1 X! g! b5 r5 y
    Call PrintDatabaseInfo(divSet(8)) / N  s9 i! f# q
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 5 Z+ m+ O" }) h0 D
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
' B5 Z- n, L. i8 |/ r: ]' j    Response.Write "&lt;/Table&gt;" / O+ V  P! R' V* d* B
   End If
: N9 L. |! k! k) w8 P( FEnd Sub </P><>'Destructor 2 f+ q& K3 C! k/ |' f" Q1 U
Private Sub Class_Terminate() * p+ x, R. `. ~% a+ ~' E4 b
   Set dbg_Data = Nothing $ o2 w1 N% Y& o# {6 U$ m
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>& r" G$ Z- ^3 z% {7 r/ e. Q. H( r3 m
CLASS debuggingConsole
% S, ?6 {9 e# }. v# C( p/ O/ NVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false . W* _2 ~: L( N0 {
&amp;n3 k# V' @4 w/ D
bsp;
% Q& }+ h$ |! s1 m, q$ q  M' d5 j2 qProperty Get Enabled===[bool] Gets the "enabled" value 6 `2 L; _5 y: |8 \' y' \+ J
  
) B) Z, h: I9 f( d  C- WProperty 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 S( [, I3 s2 ~; {4 `0 @# H  5 _& G$ A: h& D9 j1 `2 V5 l
Property Get Show===[string] Gets the debugging panel.
3 h9 Z* ?. ?' [0 z! p: g  
% C( K+ g& G4 s  U9 C- }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><>-------------------------------------------------------------------------------- / S9 W( s  m' P0 N; V5 \6 h1 q8 ~
Public Methods </P><>public sub===Print (label, output) 5 o- O; h( y+ |
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
7 d) U$ N5 F9 p; g2 `   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
/ T$ x& B: x7 k9 v   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
& w: I: C0 O, n4 {& d) QMethods Detail 6 K9 X# n+ c- T: G4 w
  
0 m$ u) Y9 E! Z1 Y6 P. lpublic sub===Print (label, output) ) B$ A8 C( l- J' E
Parameters:  4 z! E5 D! `. B$ ^8 Q! m
   - label [string]: Description of the variable ' o1 F; r3 k7 v' x# @- E; I
   - output [variable]: The variable itself $ n- u* }: T- i5 H& ^
  
8 x0 D  J1 d- ^* t/ z0 gpublic sub===GrabDatabaseInfo (byval oSQLDB) / A' f( Y% u) L. j+ d9 I: m
Parameters:  
- c6 d5 I6 Z+ ]   - 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-7-18 10:03 , Processed in 0.432423 second(s), 57 queries .

回顶部