QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
- H' g" P+ _4 k5 r3 _" n9 F7 @<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! $ C% v0 n* k9 \" l' G1 J7 l
使用方法很简单:
1 ?; Q+ C- s8 }2 q( k: stest.asp </P>
# Z' Z5 ]/ @7 J' ~. Y4 U! T! m<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 1 ?7 q* r% `! w$ d  H
&lt;%
& G: n+ w* S3 [3 B: [output="XXXX" 6 L2 r6 r& P8 X" V% s6 h0 I
Set debugstr = New debuggingConsole
% l- [4 d1 c6 n/ [8 Wdebugstr.Enabled = true ) D  Z9 i/ }2 V  M- {& Y
   debugstr.Print "参数output的值", output
: B8 Q5 p# W' Q( q  M# U) a! Y   '……
  f  `# K4 q$ E- `, ?/ l* y+ k   debugstr.draw 3 ]6 j1 Z; O" K! Z4 P/ K
Set debugstr = Nothing * c0 w% J6 h" x$ z% R: o6 ~5 {
%&gt; </P>1 p1 m( T( j' u+ Q  ]' }* Q
<>=================================================== </P>& F  k6 f' u, ]# D- [; Y
<>debuggingConsole.asp </P>: c6 L# z/ N+ b+ ?, A* c8 y9 {
<>&lt;%
0 h# G# ~+ y: {9 B8 L2 O0 C& }Class debuggingConsole </P>
0 C1 g/ U3 Z; ^, I<>   private dbg_Enabled
- Y- G  H5 ^) O9 C8 Y# P/ F   private dbg_Show
; X+ B1 V1 Y, }; k5 K   private dbg_RequestTime + o0 X% ?- @% Z  @! E( _
   private dbg_FinishTime ' n7 ^0 |# K  w4 B2 d
   private dbg_Data
+ j$ ]( x1 t- e) a4 V0 y5 ~% V% H" D7 m; v   private dbg_DB_Data
8 _5 D' A4 y$ N& W/ M7 @   private dbg_AllVars 8 c+ ]% f# `- z
   private dbg_Show_default * ^. {# h8 Y: G1 a- O4 M1 }! Y
   private DivSets(2)
% F, m" A/ P( R' @- i/ c$ }+ Y" n   
& [# V( ]$ e' }+ F: u( ^'Construktor =&gt; set the default values $ J' {) N6 b; H0 @7 s2 h
Private Sub Class_Initialize() ; S5 ~' L1 I  g. e; j3 {
   dbg_RequestTime = Now()
/ u0 g' g' v" E  T( z& z   dbg_AllVars = false
2 P/ T5 e# E( P   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
, O' ^" A) c$ z& _9 J; s6 m<>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>" i8 e0 ~: M5 Y( G9 Y
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
. A& w; u4 z1 b- e&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>
8 o1 Z  \* B) Q- Y7 N/ |' q# H$ N<>   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>
8 c! n- ]4 k1 C# B( t) q8 m<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ! W/ o/ q" J/ R8 W
End Sub </P>9 ^0 n; {  U  t# o- A
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false . A9 i4 F2 e  V8 p
   dbg_Enabled = bNewValue
6 Q. G5 N# ]8 @3 i" E4 GEnd Property </P>) Y* n7 {7 q. q5 j+ ]1 a
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 9 M$ l! Z) m) A
   Enabled = dbg_Enabled
6 T$ C) U  |+ d, @; q* l% hEnd Property </P>( u  v$ N8 j5 |! _
<>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 e5 q+ `# w! O6 i
   dbg_Show = bNewValue
3 B8 z7 |+ y8 y' D/ J: }End Property </P>
+ K( g1 Q  d9 \* Z' y% _<>ublic Property Get Show ''[string] Gets the debugging panel.
( c+ B  Q  w' y   Show = dbg_Show
/ {& L% t% @' ?' bEnd Property </P>
( E8 K! o+ z" h- i, ]8 o<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false ; D/ @; ^" @  @2 R" G4 u
   dbg_AllVars = bNewValue
( w  `. ^3 F# j$ t0 ]/ UEnd Property </P>5 T, a3 ^! u4 D6 G; t- }* y
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. ( W+ ~7 j# c3 Z! p' U3 o2 @
   AllVars = dbg_AllVars 9 a# F$ U* p3 e% g, N5 q
End Property </P>! h" ]) @# F1 K$ n6 B9 d, ]/ ~& F
<>'***********************************************************
( @0 m  t+ u& X: l8 Z" H# B''@SDESCRIPTION: Adds a variable to the debug-informations.
; p6 [; ?1 K& _, X, T; x! E''@PARAM:  - label [string]: Description of the variable
* V3 z/ X- N1 P& I. b''@PARAM:  - output [variable]: The variable itself
6 @( V7 \* S  J' e& N- ^; c'*********************************************************** ' e7 b3 M5 M: y( I! v" u% M& B
Public Sub Print(label, output)
8 q6 N% `( u* B- I8 f& U   If dbg_Enabled Then - U2 X5 t* i. I* C% Z; W9 L$ F
     if err.number &gt; 0 then
* Z5 e/ L* I) Q! l* P/ R) G       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
8 l* P* [5 @0 x7 z7 O! v0 z       err.Clear
6 z1 o& w$ U; i3 Z3 s     else % t0 B# o' N  x2 K' E
       uniqueID = ValidLabel(label)
( X( N% F6 w* @" @& Q6 t7 k* S       response.write uniqueID
) q5 W% b4 j$ m# K- ]       call dbg_Data.Add(uniqueID, output) 9 c+ ]7 p( m* o5 B( m+ s
     end if
1 C  @4 U8 {9 o/ m1 H8 L. b   End If
  L& J: a8 n# K2 S' NEnd Sub   L( f. x7 C. |( v% r% N, A$ `* b
  
" Y7 G: I8 E' a'*********************************************************** ; B& S0 D6 x- J; H, w- Q
'* ValidLabel 4 y5 V$ h# n7 S& x
'***********************************************************
2 _" S' R) Y. g3 ^" G  ?Private Function ValidLabel(byval label) 0 _6 R; h2 k9 z" H7 E  O+ v
   dim i, lbl * c% K. {" ~8 O
   i = 0
' |3 m  Q1 P- t+ T! R   lbl = label
# X& Q* u) t" J% k! l& d- H8 W1 J, B   do
6 J  W  j7 M. v8 K; R' E   if not dbg_Data.Exists(lbl) then exit do 7 |3 O0 b! B/ e* O# i- N% D
   i = i + 1 - H1 A. p: x, M& a% J" p
   lbl = label &amp; "(" &amp; i &amp; ")" , h) n- Q; v* k+ D6 V/ R
   loop until i = i + M: G% _& _# D, U
  : h% q' c2 n3 v4 z
   ValidLabel = lbl
9 B. Q3 z7 l3 Z1 g* r/ rEnd Function 6 g0 T1 V% Y+ G2 s5 I: k" l6 W( ]) x
  
* [7 s% R5 d; z5 |9 o$ J; o'*********************************************************** ! q3 C" u: J7 T& C* N1 E/ T
'* PrintCookiesInfo
/ h: X$ o6 I1 `1 H- d, D'*********************************************************** ! W; N9 b4 ]+ X7 g% F7 R
Private Sub PrintCookiesInfo(byval DivSetNo)
: B) h7 v5 [. m! T! Q   dim tbl, cookie, key, tmp
8 ~: U1 @1 }" J  p& i   For Each cookie in Request.Cookies 6 A: v: ?( O' S8 }
   If Not Request.Cookies(cookie).HasKeys Then / \7 O5 G+ h; a6 Y
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
5 h# c7 u5 k' b$ u1 {+ l! B   Else . d$ I6 w' G# X) ?$ j
     For Each key in Request.Cookies(cookie)
( c$ T* e8 u; e( c+ _. [# X+ ?. s     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. % o/ s5 e6 Z6 ]; x+ X! W1 w) B
Cookies(cookie)(key))   ( G" X" w; X" n5 h' A( D; J
   Next ! r& W/ H- i5 e2 m2 o& P
   End If " r) E# |! @3 x
   Next </P>
+ \! R+ p) ~/ ?8 g$ Y<>   tbl = MakeTable(tbl) . B5 c8 x2 Y6 p; {# h# Q& o
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2   C" g: X8 s, D. j2 A
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) - e: W9 Z( J+ W& u# Z1 k! X) V9 n2 h
   Response.Write replace(tmp,"|", vbcrlf) ( f$ T* Z2 d+ e: m1 Y1 U( u0 M
end sub 0 D/ h6 l! q- L* }
  
9 }5 B0 K9 o" Q- Y0 w'*********************************************************** 6 L" Q4 G) {; z' l
'* PrintSummaryInfo
3 S- F2 _' \) t'***********************************************************
, l4 e- j3 e( w8 LPrivate Sub PrintSummaryInfo(byval DivSetNo)
8 X, C! P: O% D) j+ t2 y. ?   dim tmp, tbl
- X; g6 {4 ?6 |1 F" p   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
  p% @+ w2 w: d+ N   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") % H" v$ t/ Q4 G& S! C1 E7 ], j$ e1 K
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) ; j) H' r$ n" A! l! m* B
   tbl = AddRow(tbl, "Status Code",Response.Status)
7 _- N% g  k! N$ h" E" U   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
& m1 T7 V& {, Z3 I   tbl = MakeTable(tbl)
7 j1 h( f  c6 a2 @: `+ }  K   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
  K8 q! D" v: E) }# O5 H+ M   Response.Write replace(tmp,"|", vbcrlf) 4 @7 O. \$ W2 Q8 I9 L
End Sub </P>
5 z- d( O# s% Q& ~<>'*********************************************************** ( K# e* ~  E  _- {$ s9 D
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
+ Y! c% Y, A6 A! b) u% K''@PARAM:  - oSQLDB [object]: connection-object
# R; r$ |8 V. C+ G& ?'***********************************************************
, w$ r- t5 Z2 X- d, ]* G& p5 H9 vPublic Sub GrabDatabaseInfo(byval oSQLDB) 6 r. \+ z% K! E
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) / f" O# ^; F# F, p& p% f. i
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) + J8 p. `0 c: P4 `( T4 |
   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")) ) L( ^& [0 Q7 O  V; H& |2 ]
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
3 f+ E, D  ~4 [; Z6 j% eEnd Sub <>'*********************************************************** # z$ T& i- c5 ?4 n
'* PrintDatabaseInfo $ s" W; U+ D6 E2 K; T- d
'*********************************************************** ) g. i# C" c, P, o( G* r7 r8 _& n
Private Sub PrintDatabaseInfo(byval DivSetNo) : N+ B, ]: j% v7 e& W
   dim tbl : k, t" H3 C* j+ [) y/ o
   tbl = MakeTable(dbg_DB_Data)
/ ~3 V& H& X6 c1 c   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
# J0 q* {, |# a/ u   Response.Write replace(tbl,"|", vbcrlf)
6 J5 I1 |1 J& o/ zEnd Sub </P><>'*********************************************************** $ H+ ^9 g8 r0 |+ ^! h& U" \* O* z
'* PrintCollection
$ g+ O8 {( Y0 T'***********************************************************   e- G. B, g" h" n  {6 G
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
8 J  ]5 t( c8 |! F, S) |   Dim vItem, tbl, Temp 3 O# _7 |- d1 p1 Q# {
   For Each vItem In Collection
- a( x+ n% h3 B     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
' |3 G$ Z: w; o( E       tbl = AddRow(tbl, vItem, "{object}")
5 g6 N7 J7 R  ?* U, F0 `' Z     elseif isnull(Collection(vItem)) then
9 d( v: z5 h; a7 Z( y9 ^, I       tbl = AddRow(tbl, vItem, "{null}") 2 z& c- t+ p, e- G: f, @/ i
     elseif isarray(Collection(vItem)) then 3 U9 t& {1 G) B) u1 Y$ U; W* [
       tbl = AddRow(tbl, vItem, "{array}")
7 m# U% K8 P; S% V     else / d$ f, S$ m/ U  B+ t( Z
       if dbg_AllVars then * j4 D5 y! U, l
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
+ E8 n! T$ `  [! y) Y6 M% g     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
+ W- @0 B8 n) |" P       if Collection(vItem) &lt;&gt; "" then 7 k1 Q3 [; @6 H  S& L! G, e
       tbl = AddRow(tbl, vItem, server.HTML
8 G4 ]8 l: X5 f" X7 |" T3 HEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
5 p& I1 u9 f+ q. n! b6 ^       else
4 T/ _% G0 X. D, |* _4 z( `. d       tbl = AddRow(tbl, vItem, "...") ; \% {& _: X1 k4 X4 K' h
       end if
2 O9 K5 n- O$ [5 o# Q3 y$ M9 z     end if
3 d7 ^0 x# x2 w4 F7 X   end if
; Z) ~' e: I6 `% j   Next
3 A& i- P5 g8 t/ l* a7 Z+ u8 c/ A   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
. f1 c" S' W" s, l8 M2 d   tbl = MakeTable(tbl) - x" }$ b: R2 ?
   if Collection.count &lt;= 0 then DivSetNo =2 # h* _' G' `0 S
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
5 b9 P0 d3 [" ]2 }: |( U  H: v     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
/ ~. N! [+ f! }& ]8 ?7 |4 D; j     Response.Write replace(tbl,"|", vbcrlf) ! _/ Q! f# m  C7 v! I
End Sub
4 L# }# L1 f- m8 F( O& L: L  
+ A  D* B% R0 d7 N$ J& s) z'***********************************************************
2 Q* p6 e6 h( b: r'* AddRow
! c$ b( F' f1 b  O( `& W'*********************************************************** 5 `3 P* m: L, ~5 h' E
Private Function AddRow(byval t, byval var, byval val) $ A8 `! e* M; Q+ M/ t8 D
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
0 _( p2 {& k: t/ |   AddRow = t
8 V0 ~. K  R  vEnd Function </P><>'***********************************************************
0 S7 F+ m. o8 P! o% O/ g'* MakeTable
. {( r& J& X5 |: j5 F; _7 q/ c'*********************************************************** 7 w; l/ m( @, v0 l) g
Private Function MakeTable(byval tdata)
% B6 [& `- l! H. r( L) u   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
& q- H$ L8 t" R  g1 |' {5 h   MakeTable = tdata
1 ^; O: p) ?, L$ d1 tEnd Function </P><>'*********************************************************** 8 F* k) r& K6 E; r& E8 s' H
''@SDESCRIPTION: Draws the Debug-panel
) o  |) J4 x+ ?% L" R% i& B! A$ y  j'*********************************************************** % h3 [9 s1 B0 a1 Y/ ?$ k/ P4 G" B4 E
Public Sub draw() . {! h4 K: c$ B$ B; l7 \
   If dbg_Enabled Then # f  y2 |. u& W0 T
     dbg_FinishTime = Now()
( t  Z4 x# R, K$ N2 M  
+ c. t0 z+ {5 y1 r! D; }! }8 v, ~0 h1 V   Dim DivSet, x 1 G* \" Z' D% w  D
   DivSet = split(dbg_Show_default,",") , V: k/ z/ E5 R7 S9 E9 ?" Y
     dbg_Show = split(dbg_Show,",") * H: K' y. b1 Z" I8 f
  
' W" a3 o$ D! g3 L; A3 E) I   For x = 0 to ubound(dbg_Show) " c' s5 X' h6 D2 D3 Z
     divSet(x) = dbg_Show(x) / W% T9 h4 }5 P
   Next
0 {- p5 z: c: U: b# j( W    w" X: W& L& N* @9 {
   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;"
& S! ]8 ?3 N- [: W( c$ o   Call PrintSummaryInfo(divSet(0)) $ @- m) F7 p0 h; m# Z7 ^
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
1 e8 |, C5 F! }! E    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 7 F% ?0 M) ]- M! A
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") # l. }- }; T. b: |
    Call PrintCookiesInfo(divSet(4))
& |* `1 ~4 L1 q; ?    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))
& L3 _% Q: j# R* ]" O. j    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ! [; Q6 N0 T1 n: r9 w
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
1 L( Y! j6 H  ?    Call PrintDatabaseInfo(divSet(8)) ; i% s$ s: K1 e& u$ l" U  v* G
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ! c6 b+ e5 i/ p( l2 p4 Q7 n" h
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
# _1 q! Z8 b, i& [4 t: I    Response.Write "&lt;/Table&gt;" - ^! `# z5 M3 i5 ]( T
   End If
; X/ n) ^! E4 H: MEnd Sub </P><>'Destructor
/ v  K& r. ?6 @$ PPrivate Sub Class_Terminate()
2 c7 g. a- Q8 ]) }! o   Set dbg_Data = Nothing
: ?/ d! S: ?- E( K) k- oEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
7 b3 q1 }, b2 v% S4 @CLASS debuggingConsole
4 ~8 q) g0 o* @2 {: L. q. IVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 Q: l. {4 u  S0 Y5 ^& M. p0 ?. [&amp;n% }( V! n" D0 f
bsp; " O1 h7 H. p- J- A+ \; t
Property Get Enabled===[bool] Gets the "enabled" value 0 T5 Z# D4 w3 h1 G1 C3 X1 i
  ( f4 B- j' v) X: 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 ' D* s, e2 ^% N- r5 E
  1 P& C# l, o  t+ _* q' ^
Property Get Show===[string] Gets the debugging panel.
# D2 P9 t2 O, J1 ~! `  ' Q2 e8 I4 z" w) f5 ~
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><>--------------------------------------------------------------------------------
/ F2 m! M- E  y3 V( CPublic Methods </P><>public sub===Print (label, output)
9 W% g2 p1 N6 i" N# [3 T   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
% {& @5 ?" P0 h0 K) g! i   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
+ f7 r# P) s- Z2 |5 v7 k! R   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 1 o' h- [+ B. ^% N: ?; t
Methods Detail
, O6 }3 ~2 p3 Z) r. z3 Z; f  
) O, i, b5 A7 t; r/ Bpublic sub===Print (label, output) % |7 v0 l2 s- Y
Parameters:  + |) Q* r5 e: U6 |) |, T
   - label [string]: Description of the variable 9 v. x3 q4 W, z8 a
   - output [variable]: The variable itself
& ?7 v% T7 }& {) q7 `  
) }) r! g, o4 `, s# Opublic sub===GrabDatabaseInfo (byval oSQLDB)
! h* I, ~- k& [9 i. dParameters:  9 f9 b6 E! m0 U2 Y: P- C2 X/ p1 \' H
   - 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-10 08:57 , Processed in 1.768647 second(s), 57 queries .

回顶部