QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
( |1 k6 z- P. E# Y) X+ I, J# c<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ! J0 ]4 E4 I2 `/ q7 j- m
使用方法很简单: ' Y, `$ ?" D2 k$ `( \
test.asp </P>
' @4 @. ^' Z! ^/ }5 h$ X" K<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
2 H4 ~1 ^' `5 d&lt;% + E5 u9 S8 B( D6 B$ M* ?
output="XXXX"   m/ |8 r( H" Q0 ]8 G. F2 [
Set debugstr = New debuggingConsole
: [: x: K* H! v0 w) Zdebugstr.Enabled = true
3 Y  f+ G: j3 ?' o9 w   debugstr.Print "参数output的值", output ; Q8 b) h1 m: O; P; T% v
   '……
, @) ~. M1 n. f- q) Y- e( s   debugstr.draw 5 K. t, z4 ]2 @" T) x1 t5 P7 k
Set debugstr = Nothing ; @* X+ f2 u; s" e  J
%&gt; </P>
8 o. N2 _1 {9 f4 g1 N<>=================================================== </P>) E7 z6 [$ C: x) ^( \
<>debuggingConsole.asp </P># k  B0 F6 e" K/ \
<>&lt;%
6 m+ I+ B9 O4 z* x) \1 z9 J1 FClass debuggingConsole </P>+ [6 R  c$ `% B& Z% H* }
<>   private dbg_Enabled
8 }: H) Q7 n& W1 o- K* h& H' T4 v   private dbg_Show
. M1 D" `5 m/ p( T5 b   private dbg_RequestTime
( n* @: D6 J0 ^0 v6 w) o6 D3 Y6 j   private dbg_FinishTime
. ^4 @8 r/ N8 Z* L2 I   private dbg_Data
" p  Y% I2 @# z& p! d$ Q) g8 f   private dbg_DB_Data 0 j; E1 h: t1 `$ g" q
   private dbg_AllVars ( U$ h5 |0 z+ z
   private dbg_Show_default   l1 `( x4 [1 T7 h% F3 X
   private DivSets(2) 7 V* j/ h5 S: D- d$ I8 V) D
   3 L. K9 \3 d$ W( `: N8 e+ w7 I1 p
'Construktor =&gt; set the default values % E- }1 m' \4 j& M
Private Sub Class_Initialize()
# d& x* B/ T) Y& T+ B6 s   dbg_RequestTime = Now()
- o$ R+ L5 R) C& X   dbg_AllVars = false ! w1 t  y4 r& M4 K! [2 I$ I' W
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
' k0 L1 S9 E1 g, L, \) [  K<>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>
7 ^' `$ ~3 |% a# r+ T4 y: B3 G<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;4 Y5 |+ D% P6 R! t
&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>
# t5 i0 a1 V, D7 ~<>   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>+ |' y2 ]! P# f" k) J; O
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
0 X6 W# Z( N5 O7 SEnd Sub </P>
6 G6 {3 M$ k1 F9 g6 K/ w<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false ) ]! C# }* U6 g& s
   dbg_Enabled = bNewValue 0 e. C* ?% z; {' C
End Property </P>* `( |( d* U  {7 }, Q8 j
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 5 F2 m. s  |, O/ `$ X; m# o3 d7 j
   Enabled = dbg_Enabled 8 ]: d3 g( C- [, t- J
End Property </P>. [  \) u1 |) f2 ^5 Y
<>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
# e/ y; {0 G6 L4 }6 I3 I   dbg_Show = bNewValue ! f& k- ?" f* j% g( D
End Property </P>
6 [8 L" I; e( L% h<>ublic Property Get Show ''[string] Gets the debugging panel.
% b+ s% l) E! F) b   Show = dbg_Show
% _. W" O. b* b/ q  W$ eEnd Property </P>% y- p" A2 [' Y4 P& V( H* Q5 c
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false   E7 r" |3 v+ G6 s
   dbg_AllVars = bNewValue   t/ O* C# ?5 l& r* ]/ n
End Property </P># z8 E1 F! |. \+ |4 G; u/ [% P
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. ( I7 t% R3 d3 K- y# |8 ^, _
   AllVars = dbg_AllVars % Q7 F. R' g' X0 V9 t
End Property </P>
. v% a+ l& U2 A0 Z5 L! O# i<>'*********************************************************** # k3 P5 `) k( \1 x+ l+ U
''@SDESCRIPTION: Adds a variable to the debug-informations. / _4 @! E2 o- S! x
''@PARAM:  - label [string]: Description of the variable 8 e+ b6 m! V0 e# b, i1 X* o
''@PARAM:  - output [variable]: The variable itself
2 D- _: B" |  c9 w) S+ R) q'***********************************************************
  o8 m0 I: O4 ~" x4 u5 a. vPublic Sub Print(label, output) 8 B$ e* f( s: y* h
   If dbg_Enabled Then
) P$ [& _  r& Z( ?) Z     if err.number &gt; 0 then
0 o: j$ C8 j# a8 x3 b6 X. t! w' O       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
+ Z* J$ q7 [  Y: u, B: H4 C       err.Clear ) s$ }7 c1 m1 R! e1 Q8 r
     else ) e; G  E/ v6 u
       uniqueID = ValidLabel(label)
& R0 L% }1 X1 ^7 c& z       response.write uniqueID 9 s( b0 ^- a1 L1 t
       call dbg_Data.Add(uniqueID, output)
& x0 N! u1 G$ Z: ]7 j9 d9 d     end if
+ x0 C3 k6 \7 V1 K6 D3 U! s, L& Z   End If
+ x2 T- z# l3 I' \+ m, r( }/ [3 [End Sub ' s' w. y& E* o! t
  
# u+ q( i( n  g'***********************************************************
% ?0 C2 U& z: c'* ValidLabel
+ T" ]$ V0 R* K+ A; N0 b2 `'*********************************************************** * @, }# u* G/ R! P% Q, C) i
Private Function ValidLabel(byval label)
; l+ Q: K9 a1 J   dim i, lbl
- C& B; {' e; V: q   i = 0 1 x+ Y& D* z& D2 K
   lbl = label ! s) ^( a/ F7 x
   do # g4 K+ a2 D' r+ k+ T
   if not dbg_Data.Exists(lbl) then exit do 3 {0 S4 s) A7 B, T9 R
   i = i + 1 " g4 F2 D* G* U2 m2 h9 \
   lbl = label &amp; "(" &amp; i &amp; ")" ( D6 Y9 L1 O4 ~* B' m. B% P
   loop until i = i 2 z# e9 ~3 o+ q6 j
  9 h, {" ^* @1 Y9 g) v. @5 D, Z! r
   ValidLabel = lbl ' X9 D: H1 \$ c( k
End Function
" G9 C! W1 ~6 Z( U+ F+ a  
8 u- i2 n6 C8 R) m( K0 K'*********************************************************** ( z; w4 S/ ], x* q" B" i: A# X: B
'* PrintCookiesInfo / _5 K/ V2 k( t, `* n  f) M
'*********************************************************** : S* b+ @+ J/ O, ^% Y
Private Sub PrintCookiesInfo(byval DivSetNo) 7 R& I" }. @4 Y; O9 u  V$ o
   dim tbl, cookie, key, tmp
, G% E5 q1 O" }+ l: {3 {% i   For Each cookie in Request.Cookies
0 ^: u+ h% |! |2 A/ N& z. P7 {& Y   If Not Request.Cookies(cookie).HasKeys Then 0 N4 ~2 D) R! A" l/ T$ k" h
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   " O# m* V3 @( v8 x6 T  H) w0 Y
   Else
, O) V5 t* C9 p) F4 `* Y     For Each key in Request.Cookies(cookie)
  Y) K( \/ P( K2 ~     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
& i9 v/ k6 f2 |$ {Cookies(cookie)(key))   
. ]8 X: ]* y" w, z- V   Next ) x$ i2 \5 x& D, W4 [- _& o
   End If / N3 z3 C" Q% S% l( Y( z# }5 y
   Next </P>
3 G2 M+ q) C* M* V<>   tbl = MakeTable(tbl)
" m6 C4 Q" D6 K7 z   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
% ?% u4 G# f4 x$ Q0 ]7 {9 O; q- y   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 3 t5 j! {/ r6 L7 U) m) C
   Response.Write replace(tmp,"|", vbcrlf)
1 P( A2 S! @. T9 \end sub ' n5 `% `" s. h/ D. D9 F
  
. h1 @) @- R* T6 d. j& ]* \* B4 I7 C'*********************************************************** # D( l3 u2 J0 f2 a% Y3 J
'* PrintSummaryInfo + d8 G3 K. j1 }8 X  \
'*********************************************************** ) t% s/ t0 }& A& R, I% T
Private Sub PrintSummaryInfo(byval DivSetNo)
1 a  m# @8 Q; p* `; T) x$ ]5 d6 O   dim tmp, tbl 4 ]7 N1 V' Z  x( `1 m7 g) h6 v6 ~
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) ; B/ m8 b$ Z8 {6 u2 `) W' s
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
: O: I6 E! ?5 E% _' [8 \) `7 C   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) & ^; @2 ^: @8 L" i; t4 {2 f
   tbl = AddRow(tbl, "Status Code",Response.Status) 9 _4 e; d6 C7 m5 t1 R3 E* B
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
5 [) `! p7 g# I3 S   tbl = MakeTable(tbl)
' M* R$ G3 i5 i; Z1 }% g' e$ [   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 1 F: b5 w& V. e, ~/ C8 J2 J
   Response.Write replace(tmp,"|", vbcrlf)
$ U) ~6 \7 _0 c. q( C2 ZEnd Sub </P>
- o3 K) m2 T* v  N- {3 |<>'*********************************************************** ' e+ t& ^1 C6 M% s' ]5 G
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
# S1 j) F- H$ i& t# L  N8 p''@PARAM:  - oSQLDB [object]: connection-object 7 ]0 i/ S3 V+ R  T. Q
'***********************************************************
5 Y; _2 V- V6 h- m8 d3 H* vPublic Sub GrabDatabaseInfo(byval oSQLDB) & b! f( I& q7 B, G# @( V
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 0 Y. w. w/ P% \* q+ q) ]! X
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 7 ]- T( C0 [2 [- ^" h& ?# I9 r
   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"))
( t; X8 \* v8 `. U6 Y6 X7 r! X   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) $ w9 Z5 \4 Y& t; k0 Y6 O8 o
End Sub <>'*********************************************************** + W$ _1 p3 ~9 w; L
'* PrintDatabaseInfo
, c& O0 I. r/ o'*********************************************************** 9 N3 O' I: Q8 o) b- g/ j$ f+ i4 n( B
Private Sub PrintDatabaseInfo(byval DivSetNo)
& O7 q! r: J3 o& E: G  T. a   dim tbl
, D0 D4 S) Y0 V+ \6 m1 h   tbl = MakeTable(dbg_DB_Data) - M$ v( `' |8 [3 Z  j- V5 x" s
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) $ t/ u/ i7 _0 Y- n9 A* D! U
   Response.Write replace(tbl,"|", vbcrlf)
2 l- a. n) c7 z2 z* G% h$ |2 {8 AEnd Sub </P><>'***********************************************************
3 o/ B" B3 h% h; l. o# @& ~'* PrintCollection ; s, m0 P" D% h& \5 c& M7 E3 o8 n
'***********************************************************
" A# Z; t. E8 UPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
0 H" K$ U, L* W" s; L! g& j# L   Dim vItem, tbl, Temp 0 R" W7 e/ Q) z
   For Each vItem In Collection ; a# l$ E' S4 }2 ?1 Y7 b, N: r
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then - T3 `/ U, ~) V) h* ?4 O5 Q8 Z. s$ `
       tbl = AddRow(tbl, vItem, "{object}")
  M7 m, M$ o* @! r# c     elseif isnull(Collection(vItem)) then
( C7 h1 K# u6 g& z       tbl = AddRow(tbl, vItem, "{null}") ) s7 @1 c( m- y" u% N+ y+ j
     elseif isarray(Collection(vItem)) then
; N4 f& C7 ]& u6 Q, ]3 u       tbl = AddRow(tbl, vItem, "{array}")
+ }8 Q! T' {/ Q     else
# s' ~1 f* `# _: V% F       if dbg_AllVars then # C% m( X' z8 ~( h7 e
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
0 n+ \4 O6 I/ X: ]% E# ^3 d     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
* N. p% S8 j2 W/ p9 q       if Collection(vItem) &lt;&gt; "" then # B- v, O! C; q: Q, {& ]0 E
       tbl = AddRow(tbl, vItem, server.HTML
: r, P6 P7 c& y+ X8 O$ yEncode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") " M$ i7 b* U( `! C. n
       else
: s# l- w7 b$ N: M. |       tbl = AddRow(tbl, vItem, "...") + M9 p- X5 W2 c" n/ Q" Q
       end if
5 ?; v1 I$ ]3 x. y. `% a     end if ! v1 c7 z' D; d  @& e- l# N# N
   end if ( f' C7 q$ Q' s% T7 i
   Next " a# ^* J; d; j' O3 B4 C( {
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo 1 |9 z( X1 u5 x$ Q% e$ H6 B- K
   tbl = MakeTable(tbl) / I( T8 t  k# m6 f
   if Collection.count &lt;= 0 then DivSetNo =2 7 {0 L7 a8 C+ y  t- g8 U) [& X7 S
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
/ c+ g1 Z% w/ f     tbl = replace(tbl,"#sectname#",replace(Name," ","")) : r" j* u' \  d. ^* M
     Response.Write replace(tbl,"|", vbcrlf)
& g' @: V0 }+ T' _" W4 WEnd Sub " [- r7 M2 r; B) f
  
5 A- i& x/ g7 i. m'***********************************************************
  |1 _. \2 d- j  W4 b& K% n'* AddRow # ]; f% N0 ~7 t! r+ y! f1 n. P8 M
'*********************************************************** - a1 r+ g5 j! I! X7 R% [8 d" m2 d
Private Function AddRow(byval t, byval var, byval val) ; m' `, r/ _8 H) P* l% B
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 6 W. S# d9 V& n* d+ e; G" P
   AddRow = t
2 z8 B9 w. {+ ^End Function </P><>'*********************************************************** ) w# x" F+ N8 j8 W
'* MakeTable
, F4 J9 K& C6 B5 H. W'***********************************************************
2 M  M' @, a1 t% S8 B, DPrivate Function MakeTable(byval tdata)
$ k  L% t: @. @  F. U   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
1 N% q" r! I; ~4 X6 v   MakeTable = tdata ( r* L3 W' p/ g$ t# F# z  @
End Function </P><>'*********************************************************** / X5 l8 x$ d; s1 @  p; r# @/ B
''@SDESCRIPTION: Draws the Debug-panel
" ^# A- _. Z8 X4 i'***********************************************************
$ }1 o3 k* j# e: a" R. NPublic Sub draw() 9 C6 G* K; ~* |* E
   If dbg_Enabled Then 2 x/ }# }2 y( t3 O* z1 s1 w, w
     dbg_FinishTime = Now() 6 H& G& {+ |) l, S' e0 @
  
) Y' r: O( o0 ]* v+ r   Dim DivSet, x ; _( Y; o9 T, @$ r% |
   DivSet = split(dbg_Show_default,",") ' g# G) K& g1 o) F: s
     dbg_Show = split(dbg_Show,",") % m0 {+ k9 x; Z( O$ Y: e
  ) {& l" A% R& [( F- [
   For x = 0 to ubound(dbg_Show) 2 U. y' W3 y4 C+ A! {
     divSet(x) = dbg_Show(x)
4 O' i. J( a3 p& S' L   Next
0 y7 v" i8 D/ s5 x. J  3 y, g+ f# \$ e! s0 n
   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;"
- C  L& P6 w; Z/ ~. h   Call PrintSummaryInfo(divSet(0))
% ^  e$ F/ O/ I% m* b! K     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 9 u7 Z3 y$ T+ _  W1 {2 X" f1 A$ u% W
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") % _' N% U9 b# R! m
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 Q% I; c; U; \  g1 Z! U& a. |    Call PrintCookiesInfo(divSet(4))
! U- |# m* j" c( B% K) [3 T    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))
2 A: x$ m. E/ m2 ^* u; N    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") - L3 D) V5 z) P# A
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 2 q5 g* A/ I5 X8 p4 d% L
    Call PrintDatabaseInfo(divSet(8)) - W0 K  ^% o/ T- e, e/ K0 R0 Q
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
( r# s$ b6 c$ r: U+ R    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
5 j' Q' r; H+ y    Response.Write "&lt;/Table&gt;"
4 G' h0 Y% s! T8 _$ X  l# T   End If - j/ D, V% f) |: N
End Sub </P><>'Destructor   C6 f/ d! l; O  m3 W( A  t
Private Sub Class_Terminate() / I) ^8 f/ R8 \9 X( D; w
   Set dbg_Data = Nothing * H" t6 G3 w2 R+ f
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>8 q3 |" U7 t$ t& S
CLASS debuggingConsole ; K, r: b8 W. F" m! v
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 8 Y5 `! i- U& s4 o* E9 ]
&amp;n
; H, N% U+ ^. k7 e& Lbsp;
" o- m' U& T4 v, T1 r3 }& V& o8 vProperty Get Enabled===[bool] Gets the "enabled" value
; q$ F6 c% S6 w9 G2 V: c% L6 ~  j  
) P5 j5 E& b0 }7 t# U  LProperty 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  a  G4 V! |& T. ~
  
0 v1 ~6 q, [7 q0 T1 V. hProperty Get Show===[string] Gets the debugging panel.
" |$ |, _; L! u" F  " U* U- g6 |: d  B$ q; {
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><>--------------------------------------------------------------------------------
* N* C' S8 c, K# J" r' \Public Methods </P><>public sub===Print (label, output) 6 x/ q) L8 S8 D4 A6 r6 M# L
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
$ r. _* N! t) l/ {! X% ]   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
) _, c3 M. k- F   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- % J2 R5 n( ]" y6 O6 X
Methods Detail & E, B( X3 a  H/ s: H/ _
  
$ q) A, |; |6 V. W) ^public sub===Print (label, output)
6 }& L$ X( [8 Y- u/ \3 Y/ yParameters:  # L. {5 C1 _: h. A' M
   - label [string]: Description of the variable & z3 f+ w5 l6 N( n) [) g' i
   - output [variable]: The variable itself ; }& @# ]% n& O' h( s6 s; c
  3 e- [% J; r* v6 @; `
public sub===GrabDatabaseInfo (byval oSQLDB) ; l) I% m% ~+ y# X1 A; T- `
Parameters:  0 ]) u" c1 F6 E- f& d% F0 f
   - 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-9-24 04:01 , Processed in 1.434845 second(s), 57 queries .

回顶部