QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
! |: a1 C# b0 j<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! & |5 x& m# A4 p* M0 [- X7 b. t
使用方法很简单: ; \' O1 `. [4 Q; x- {
test.asp </P>8 o0 _5 t* b8 V) t% R, s
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
  t. y! a& ?) E" q6 W&lt;%
$ d* ?5 _, J9 y, woutput="XXXX"
3 N- x! ~% D' o5 C  T' kSet debugstr = New debuggingConsole
# v: U: e8 i6 x; V4 idebugstr.Enabled = true 2 C6 M7 V! m% O
   debugstr.Print "参数output的值", output
7 t5 Z2 Q; X. J6 a9 ~/ F/ c   '……
+ N. S2 S; C9 p' f# n* x! T1 I/ y   debugstr.draw - W, Q& v; N. D, M) ~
Set debugstr = Nothing + X7 R1 t# e3 G3 o6 p7 Y
%&gt; </P>
7 x+ v! w; b& {5 U& y/ H+ b! |<>=================================================== </P>/ e% l- i+ s3 B/ T5 [: ^- L6 h7 T6 N
<>debuggingConsole.asp </P>' v3 n$ Q: z* t, J$ ?5 Q
<>&lt;% 9 u$ u0 Q' {# ~
Class debuggingConsole </P>
- o8 f4 s5 O1 ~5 g- G  Q<>   private dbg_Enabled , i$ a4 k( j. J( Q9 _: I; q
   private dbg_Show % y( m2 n) v: M0 s! l
   private dbg_RequestTime
+ `) L: V2 `6 W; f: R1 E1 ~   private dbg_FinishTime 0 a) g5 a5 K% y1 q/ H
   private dbg_Data
/ S! g" {' f! t/ M+ Y4 t4 |   private dbg_DB_Data
* W* O# c1 g3 f% p$ C   private dbg_AllVars 5 \% P1 D  E$ U
   private dbg_Show_default 8 t; T1 w# t! t5 F& {# J+ t& T- j
   private DivSets(2) 5 R; B* y, t5 E
   
( Z' Y: Z/ z; D6 N'Construktor =&gt; set the default values
8 D( v0 \0 @0 V: wPrivate Sub Class_Initialize() 2 S1 {- W; }2 s" N4 M) u: y
   dbg_RequestTime = Now()
8 K" t" w1 p/ Y/ [  K   dbg_AllVars = false
0 A7 z) g( o+ x9 [2 ?3 c0 Q   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
8 y2 t3 Y2 ~8 b<>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>* x* @3 \" ]9 Y# C) T
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;- K9 o3 m, `- B3 o) U/ D- k% r/ C
&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 ^1 x$ [& O* [6 D) v" b! k7 _2 g; Y6 e<>   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>
5 D! `) q  d  G1 z& @<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"   d( |- u* p3 O, H
End Sub </P>
* p# F4 @. I) I7 a6 i<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
+ R4 |9 v5 A9 Y. ]   dbg_Enabled = bNewValue
+ ?; m$ Z9 K) M0 n4 qEnd Property </P>
8 n2 q4 U8 g$ N, I% Y<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 8 K# z" V  i! b! l- r6 d; G
   Enabled = dbg_Enabled % u5 f1 C& K: H4 z9 ^
End Property </P>
# Z  ]. |! T# N$ C) X+ C. `<>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
- G: R% }& a* Z' q7 d. R( z7 R   dbg_Show = bNewValue : b- r0 k' J3 G1 z2 Z7 e8 q  v
End Property </P>  i; N$ E9 o, q' [6 G
<>ublic Property Get Show ''[string] Gets the debugging panel. # y( l4 J# B6 I
   Show = dbg_Show
& x5 x4 z; d$ P" jEnd Property </P>
7 Z9 Q! v$ B' b9 M- T$ Y* R8 O<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
* \1 t# N8 t6 }. v1 v# Z   dbg_AllVars = bNewValue , g$ J: B# t$ ]( _* r* k. n. P9 Y
End Property </P>5 S6 F$ w6 P/ z4 K+ x; K6 y
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
7 D6 ^5 Q7 [/ u4 i   AllVars = dbg_AllVars
5 a8 p3 t' O# i( l* [End Property </P>
# l4 H7 s9 ^2 R; w<>'*********************************************************** # e- X5 A, E7 `7 P: Z5 c3 L! F. b, O
''@SDESCRIPTION: Adds a variable to the debug-informations. ' M+ ]; r' V( D: Z  F4 Z+ b  \- Y
''@PARAM:  - label [string]: Description of the variable 9 K; z; k4 F' N1 U* ?
''@PARAM:  - output [variable]: The variable itself 9 k! a$ {- t& K; w, W! T
'***********************************************************
9 P! F! B7 @2 K' GPublic Sub Print(label, output) 5 i0 |& t9 q8 X$ x
   If dbg_Enabled Then
0 }' r. y& A* E) w     if err.number &gt; 0 then
( }5 v+ r3 f& z. A6 X, `2 A0 x. N       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 2 M3 B7 K  ~9 c, Q
       err.Clear
! _9 {" T$ e2 s3 }0 m1 g9 ^     else
7 ^4 g- o+ x) T( p# d! A4 w! a       uniqueID = ValidLabel(label)
/ h3 ?1 v- y# f. |* y) i; w       response.write uniqueID & J& O0 A7 B, `
       call dbg_Data.Add(uniqueID, output) : x4 a5 H0 x& f; O6 o4 Q* m( r; n$ ]
     end if
# i7 _' `2 m6 I. _. W! H   End If
9 }, n+ Z! T7 ?" ?% C; j% k! ?* A! OEnd Sub ) @+ Z7 ~3 H+ Q  B; h
  
$ |9 A: Q6 e$ A5 T) l' C0 `0 m% e'***********************************************************
/ `# O7 h. x; N' R& b1 d8 z'* ValidLabel
$ B+ Q3 y. b& ]'*********************************************************** 7 m, B( {, u. x9 P
Private Function ValidLabel(byval label)
$ l" x2 {$ n+ d+ H   dim i, lbl
5 n$ A8 }/ i. D1 V4 u   i = 0 4 O  Z' Y: C( H6 k4 N7 {
   lbl = label % |' b) M. ^  |
   do * u, o. k6 I& G9 f( O
   if not dbg_Data.Exists(lbl) then exit do
5 @3 Z' `4 j2 B5 P/ C% l( T5 ?   i = i + 1 & ?* m, T. l& ?, r9 [
   lbl = label &amp; "(" &amp; i &amp; ")"
$ x/ y- j5 m+ q4 ~   loop until i = i + Q% ]3 s# U6 b, ]# H
  
5 i! H. t( i% ^1 Y# r8 O3 o. z   ValidLabel = lbl & D2 p* m% K( l! \' s6 N$ }
End Function & X3 P1 \3 m( |1 e* j% T$ ^
  
6 H8 O( {: z% \7 F# G( \% c'***********************************************************
) f8 b0 d9 N5 I* N: `- J! l'* PrintCookiesInfo 4 r; S* }. j8 {' n5 V! ~% w
'***********************************************************
0 [6 p1 f' k! KPrivate Sub PrintCookiesInfo(byval DivSetNo)
* G0 u2 `9 \# J5 R1 n, j   dim tbl, cookie, key, tmp   |+ e8 u3 Y- u+ T6 s% c( K! w  P% T' {
   For Each cookie in Request.Cookies 0 w- ~( A1 D% U
   If Not Request.Cookies(cookie).HasKeys Then 2 ?% F) E. x6 t* ~" j+ e' e( W
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   # B5 k' L) p( n
   Else ; o4 U6 _! y( u# Y8 c: n' G3 S" a
     For Each key in Request.Cookies(cookie)
/ e* X7 W; \% K/ I+ ?     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. $ u4 t1 E" o- a; R; r
Cookies(cookie)(key))   , ]8 i; {) ?& ^: D) q0 q& F
   Next " T/ m& r) }1 m' \$ `2 ], \
   End If
) c; u& [7 w# r( q: b% @   Next </P>
( h6 @( H- ^; h! v5 k<>   tbl = MakeTable(tbl)
" _& B1 S4 p8 D& M: n2 J' \" F   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
% Q9 l( b, ~+ L3 W1 ?4 [0 \' G   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
% p& ~8 Q) x$ V" U3 t+ ?+ w   Response.Write replace(tmp,"|", vbcrlf) 2 |4 L& E8 R# n- i
end sub 8 {& D& `. z4 P4 z$ s# w8 S
  $ d3 @1 \* W8 ~; R$ _: l, o
'***********************************************************
, Z! L' |' n2 Q'* PrintSummaryInfo
. V& @- E: T/ w, ]! \9 _  H% W& I'***********************************************************
/ y% q8 y1 \& V1 {( {# rPrivate Sub PrintSummaryInfo(byval DivSetNo) * R* L/ x( m1 Y4 p" p7 j
   dim tmp, tbl : c& G( ^8 q8 Q5 h% q9 X5 S
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
/ P) B( x/ E" ^" p! |   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") , l) X* m& y+ c& j/ |) V
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) / n( r9 H' M5 F$ T: f
   tbl = AddRow(tbl, "Status Code",Response.Status)
+ y. f+ ~  W- ~0 H" e" A  d   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) - T% P: }! A3 U7 \
   tbl = MakeTable(tbl) 7 m9 s# c( l# z7 [6 @
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 3 ~5 E# k6 y) d( l- j: H% o. ^: `' }
   Response.Write replace(tmp,"|", vbcrlf) + G- _/ R+ Z2 a/ Q6 ~  X
End Sub </P>
3 B, ]& B+ ^: q  n" @8 y<>'***********************************************************
; x0 k( p9 f# n2 t''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information " F; X5 s' Z% d) @8 r- J5 V
''@PARAM:  - oSQLDB [object]: connection-object 7 O' E1 \) @; E  t& o8 b1 A0 m
'*********************************************************** 1 o! K1 v# F' G8 [' v/ V' f
Public Sub GrabDatabaseInfo(byval oSQLDB)
. t8 S5 p% I, k9 _, q& d   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
" Y5 F  d8 M1 Y) U   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) + t2 z: ?! x% {9 H1 G. Z# H
   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")) & C$ F5 V# X# N4 u3 y
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) + I5 I* r& |' j% D, O5 D% U2 e
End Sub <>'***********************************************************
: P3 ^. [1 A6 }7 W% ]'* PrintDatabaseInfo 1 G  Z" Q; F1 X5 E* g$ X2 o
'*********************************************************** : L3 |: E6 g% D$ q; U) |" s( Z
Private Sub PrintDatabaseInfo(byval DivSetNo) / q( ]) t; p! f2 K% M
   dim tbl 8 j- J7 b  [  l- O( E: D1 E
   tbl = MakeTable(dbg_DB_Data) # Y% ]+ {$ K/ g
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 4 q$ R8 d' V0 @$ [& @+ k) @3 y
   Response.Write replace(tbl,"|", vbcrlf)
- R3 b; Y5 ?) Q: tEnd Sub </P><>'*********************************************************** 3 N# t4 H# L2 G% l0 I0 _3 ^
'* PrintCollection . P9 q; f% D" d; f7 E
'*********************************************************** " f* [5 A5 W9 l; x& e1 D6 y
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
. |) R) q# A: h  B   Dim vItem, tbl, Temp
# Y# T- l: T# C6 t3 v; m0 B) Q   For Each vItem In Collection ' d" m  d. l6 E: K
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
& k$ M$ z5 l2 P2 ^$ U* y       tbl = AddRow(tbl, vItem, "{object}") ( }3 ^. L9 G, M& D4 n8 p
     elseif isnull(Collection(vItem)) then
5 a& q4 _  n2 |# {4 I1 g) Q       tbl = AddRow(tbl, vItem, "{null}")
  X, ^- n. t7 D8 _     elseif isarray(Collection(vItem)) then
1 ]( ?  w7 m+ V8 g       tbl = AddRow(tbl, vItem, "{array}") - D5 M9 O/ \3 h5 E) ?
     else 8 y7 t4 K, ]2 P1 @+ o
       if dbg_AllVars then # h  w2 G4 ?7 g( S
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) . n+ k' O" _' q
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
3 d) c( Q: p. c- a       if Collection(vItem) &lt;&gt; "" then % y+ Y) f* B7 c) {
       tbl = AddRow(tbl, vItem, server.HTML
% Z# n2 l# V/ E  r/ @) fEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
' L/ V. j4 f5 ~       else ! f; ~# y' o1 @1 f* t# j0 ]
       tbl = AddRow(tbl, vItem, "...")
: H4 c2 b& H: ^# e+ |/ l/ K       end if $ [5 Q+ G. [" n+ ?
     end if . I, i+ n8 K, z# b
   end if
" A" f0 w+ |5 S- E. a5 B   Next + `% d8 ?) o" j6 S/ [  q, K4 F
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
% d, H5 m9 M% p; S' |   tbl = MakeTable(tbl) # |, B; z2 O8 x; q5 {
   if Collection.count &lt;= 0 then DivSetNo =2 6 p/ f6 e- I8 Y2 n0 `2 D
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) & A  t. }2 \( E" R
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
3 E" Q+ c, q+ u. |( D     Response.Write replace(tbl,"|", vbcrlf)
$ L# K+ J( [  T$ e" w# aEnd Sub
) ^; m7 \3 e' N* y" K/ _    |1 w+ j" J- e: u9 h2 `9 b
'***********************************************************
3 X& z: R4 A+ N- p0 F- [+ \'* AddRow ) _8 Z+ c& q3 k3 R: f9 P& c
'***********************************************************
) u4 y$ A- m- s9 a7 n, |; ?Private Function AddRow(byval t, byval var, byval val)
, ~2 t0 ^# L: o   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"   I* U( X4 g) w+ G9 u' j
   AddRow = t
  }& x; w+ W2 P( Z. G0 U5 d1 kEnd Function </P><>'***********************************************************
8 M, K4 _( n6 O* D0 L) I4 ?'* MakeTable
/ P4 `+ _" }! R: h& z0 i+ D'***********************************************************
& F% [1 Q( ~: T6 R8 h% qPrivate Function MakeTable(byval tdata)
# i+ @2 f1 d3 F: Y5 g- }' Y8 k   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" 7 |0 M8 o1 B/ f1 b7 z- P! ~
   MakeTable = tdata , n9 G9 h4 I4 B7 E4 o# ~
End Function </P><>'***********************************************************
4 w0 N- d$ C. a* ]0 j) B4 D''@SDESCRIPTION: Draws the Debug-panel 2 V- U4 @; p( Q+ n# f* `2 D) h" j
'*********************************************************** ( X: [( G8 j' L* X. p% `+ Y
Public Sub draw()
: ]7 q3 ^, t7 x- n9 K   If dbg_Enabled Then : F" d/ |, q9 C; [# U8 Y+ W
     dbg_FinishTime = Now()
  o6 `; X" p, |& F$ n: L  a; I    D: E1 ~  d7 K+ Q, [6 K( s% \/ a
   Dim DivSet, x
8 Y, w# |& c% p5 h; K) V   DivSet = split(dbg_Show_default,",") : k6 d  a* n6 B) l8 }8 ^" y
     dbg_Show = split(dbg_Show,",") $ }$ Y" {$ w0 Z, ?5 _
  
; m! S! w3 M; g0 \3 J   For x = 0 to ubound(dbg_Show)
3 f, \% O# k& t5 J. i  ~* e+ {     divSet(x) = dbg_Show(x) " R0 w0 S8 i3 l' c' w- U
   Next
1 \( I$ H8 z! |  k' t+ m  + J( A% T! Y+ Z- g2 Z7 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;"
4 o% |* a. Y+ U, A/ V) Y   Call PrintSummaryInfo(divSet(0))
& C0 _7 @: ]2 O. G7 f1 a# v- \& r     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
2 @3 C' @0 X4 C. H% c! [4 a( A    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
/ z$ l% i+ p8 ^$ Q* K2 F4 r    Call PrintCollection("FORM", Request.Form(),divSet(3),"") ! Q( Y# e0 n( O' ^2 E4 ?0 v
    Call PrintCookiesInfo(divSet(4))
2 z1 F, E( R) U8 V) b    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)) " J; ~5 ~" x+ {) I
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
7 x% }% ]* ?) X, A- Y    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
2 {6 L" X; W6 F) z    Call PrintDatabaseInfo(divSet(8)) ' o5 r0 ?6 ?2 c4 u6 q& U8 T" k
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
2 [% U9 l/ Z  ?$ t    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
, i  M/ N+ c" G  t4 [' R; E    Response.Write "&lt;/Table&gt;" ' C8 s5 K& T; q7 F- i
   End If
0 S1 h4 Y5 i. X9 zEnd Sub </P><>'Destructor 7 `/ N# _$ z9 ?; X  |
Private Sub Class_Terminate()
% G% y. C+ M6 I; s3 P8 \   Set dbg_Data = Nothing
' i+ ]7 j! ~' l- a) @8 D+ uEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
7 f5 ?2 t: W2 ]4 e; C2 S1 ZCLASS debuggingConsole
: i; S6 k; O: u, z0 @" B) UVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 4 f5 M0 b8 A4 S1 s% ^# g
&amp;n
0 N& z' M' G$ F! k/ jbsp; 9 P$ x+ h3 D0 r5 B4 `2 n& }
Property Get Enabled===[bool] Gets the "enabled" value
) A" x7 _" @4 @) ]. E& o  $ b3 s: h/ O2 `' k: j4 O1 o
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 N) E' V" u! _" W! L( ^
  , o2 ?( f) h( p
Property Get Show===[string] Gets the debugging panel.
5 a& X( e) S9 E# a, g1 ]1 t& Z  
' q4 a) G8 u' D5 V9 ZProperty 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><>--------------------------------------------------------------------------------
. c! y  j6 O% [% zPublic Methods </P><>public sub===Print (label, output)
4 u5 I: ~5 V5 M  o   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
3 E% t( a' l: _6 S   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
# U/ I" W% g  o1 T/ f+ Y% n   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
/ T2 a* c+ |- L- ~% tMethods Detail : K7 \0 p  C% F4 y' J8 n  r
  ; |% ^) c8 H0 W+ X" w" [$ f5 A1 {
public sub===Print (label, output)   X5 w( @, F; v- Y4 A6 ]
Parameters:  ' x4 k/ H; j3 s  T
   - label [string]: Description of the variable
8 \6 h7 G! b1 c% j* t/ O, v   - output [variable]: The variable itself
8 H/ l  m; H) G0 V0 e' j$ |  & r9 [  ?$ b$ g# L0 i* W4 h
public sub===GrabDatabaseInfo (byval oSQLDB) , L1 c- B9 ]' i* A& q/ {( c. L
Parameters:  
# K- j7 V# x. a* 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, 2025-12-11 23:50 , Processed in 1.097263 second(s), 56 queries .

回顶部