QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>6 O% K2 P- Q( D7 s% m9 g
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
5 o6 ~' B3 ]* E1 d使用方法很简单: 8 I9 P$ D; U! t
test.asp </P>0 L3 j& F( d" `  r! w
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
% @; D+ U8 ?/ g&lt;%
" _- H$ [7 m! ]+ P0 w5 B1 qoutput="XXXX"
6 R) A4 [$ r* Q/ d) ?: HSet debugstr = New debuggingConsole ' d% J! h7 I. T( s
debugstr.Enabled = true
8 h8 c) C' [; \" v( k; A1 f( E   debugstr.Print "参数output的值", output ' |2 t$ l. T/ U" H& n/ a
   '…… 9 u( s* i: h; |% y% l
   debugstr.draw
1 Z1 V: D9 C" z2 L4 p9 n' QSet debugstr = Nothing 1 a+ q4 e* K9 j# B) C- ^
%&gt; </P>+ S) s! \' d' o
<>=================================================== </P>) T7 s; p0 U1 Z' M# P) n
<>debuggingConsole.asp </P>: l5 K! Z5 {6 g+ A
<>&lt;% ' N1 ]# R- v4 y/ a0 J* O2 a  |2 {
Class debuggingConsole </P>
. O9 ?% A. G: Z5 h+ W' E<>   private dbg_Enabled
  [; s- |7 Y9 H( G7 c; M   private dbg_Show $ k+ T3 T- X6 B# l2 I$ c+ @# ]
   private dbg_RequestTime
; [, p) U+ {/ L# d4 |0 P   private dbg_FinishTime
- q- Q( p& E- M0 e/ H/ v   private dbg_Data $ G# c* N5 s5 j' d) K
   private dbg_DB_Data
$ ^" F* H- s9 G# ?3 ^, P+ [   private dbg_AllVars
6 _' Y# D  ]  A* [/ S   private dbg_Show_default ' ?6 d& J- t, F/ ]! L
   private DivSets(2)
# m; C9 S9 [2 C; c) ?0 E" i   . l9 C0 S0 }# E/ C; h5 F+ R
'Construktor =&gt; set the default values
) Z1 p) ]+ p; F' o5 {7 D8 gPrivate Sub Class_Initialize()
2 {" B- q. {$ d4 J   dbg_RequestTime = Now()
+ ]7 E# x1 C; c! x* l0 `+ C   dbg_AllVars = false / S$ I# M* Q$ o: C1 n& G9 k
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
) T! Q8 \8 y8 U/ 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>1 ~  f9 \6 a' B* ?1 p) N
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;/ ^4 W/ |2 X3 z
&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>
# y9 i6 W  q( v  B2 B! D<>   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>! E& @$ y5 h$ n+ I, L  f" [6 X
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" ) X' C1 j( {9 `4 t* ~6 c" W3 ?4 s
End Sub </P>
  R3 I. g3 e9 a4 {  ~<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
! `1 \4 l3 G& ~0 U7 d   dbg_Enabled = bNewValue
$ g! P0 a& [2 QEnd Property </P>& H. l* |9 s# y5 j/ p% e  C
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value : t& A+ @1 u8 u" A4 p
   Enabled = dbg_Enabled ' Y) l% g2 Q% g- z9 f
End Property </P>$ ?% G6 w1 w/ `- f" l" U
<>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
3 L9 e5 n0 {9 w2 ?   dbg_Show = bNewValue
+ s% j8 p: S3 ~+ C* z0 b1 `/ AEnd Property </P>5 e" a, p( O4 d* z$ ]9 z
<>ublic Property Get Show ''[string] Gets the debugging panel. 9 u. t# h' r3 a3 k0 |
   Show = dbg_Show
8 K8 E! A( W. fEnd Property </P>
; ?2 O( b; G, E: ?. P<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false # i, p. m/ ?' s; o5 [" I4 n
   dbg_AllVars = bNewValue
  \4 \2 ]0 d" y9 g4 }2 \1 |) j7 yEnd Property </P>
) n: S9 U3 L; i4 s5 D- d9 M8 r<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. % B" J' W' d8 }- b5 N% N
   AllVars = dbg_AllVars , W7 F  m2 h- Q0 Z" ?
End Property </P>
/ `3 D+ _3 D. j, B+ D& u& L<>'***********************************************************
* P3 n8 Q7 R9 e) R. l/ w: y: H''@SDESCRIPTION: Adds a variable to the debug-informations.
( L" C4 b  Y* Z) U2 s! v''@PARAM:  - label [string]: Description of the variable 3 Z  e  @- T- z0 f
''@PARAM:  - output [variable]: The variable itself 7 R  V. p5 E! ?
'*********************************************************** % h; O, ], z0 @: y
Public Sub Print(label, output) - W4 t: }6 ~  J
   If dbg_Enabled Then 4 j4 R; r4 P4 M  C$ p3 b, d. J, _$ c
     if err.number &gt; 0 then
$ T7 w5 V3 m; i0 [6 B& V       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
8 |4 s6 ~+ N$ w: O* v1 T       err.Clear ' h1 I! S& u' F. o2 R
     else . U# F4 s- s, n' D
       uniqueID = ValidLabel(label) 6 p( P. _) d% A" n+ d, h( G
       response.write uniqueID
' S3 r1 l" E* F3 Y0 {; N. @       call dbg_Data.Add(uniqueID, output) # C! r5 M" }  \, |9 L9 P) O& {% g
     end if
8 h% w5 O3 @9 z6 C1 b   End If
2 N/ P: ]6 W; c9 z$ f+ b8 WEnd Sub
& S! n, C- x; u5 o& `( ]  0 ?. @( n7 i9 M0 p7 l# H
'*********************************************************** 5 V! G* j$ b, I% ^- j& L' E/ [
'* ValidLabel : ?4 A) X5 T1 Y/ V* ~+ e# _- e
'*********************************************************** ) S' Z) D+ E/ k5 Z7 I3 H# N0 R
Private Function ValidLabel(byval label) . B/ C( I4 g6 Z! m) K
   dim i, lbl
# v5 b6 [! [% U' L9 h   i = 0 ( T! V. y4 _& a; W3 s
   lbl = label 7 I: T& z: O* G5 I" o
   do 5 T; a7 b. D* o' v, Z; W
   if not dbg_Data.Exists(lbl) then exit do
8 z7 Q( T! l2 i9 ^; O0 Y9 b8 F   i = i + 1 + a: D  Q5 k/ I: ^- c  S
   lbl = label &amp; "(" &amp; i &amp; ")" 2 D5 Q: E+ C! A) `
   loop until i = i ( P2 F2 E9 N6 s0 p, c0 v9 Z9 q! P* p% c
  , l" F5 F' c# @
   ValidLabel = lbl $ s! g  I! ^" Y: c4 B
End Function 6 Y3 L; \& f" V2 Y( r8 _9 R( ^
  ' E% u$ s) ~1 R$ ~+ s
'*********************************************************** - J7 F: d/ b; M  H1 Q# [
'* PrintCookiesInfo , O  h) F9 W6 q0 K* U
'***********************************************************
, C! e" `  y9 qPrivate Sub PrintCookiesInfo(byval DivSetNo) ( ?/ t$ X7 I" {1 y' x0 _1 \- x+ U, ]
   dim tbl, cookie, key, tmp * f$ C* K7 t3 z" P
   For Each cookie in Request.Cookies ! L9 W: v% R9 ?$ S/ q
   If Not Request.Cookies(cookie).HasKeys Then 6 E( u2 U2 _$ R9 ]$ l" t! j: {
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
$ D' l8 r, ]5 c   Else " |2 @9 }( H4 |
     For Each key in Request.Cookies(cookie) 7 Y$ u9 G; m/ z& ]( h
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. ; s8 f5 }* D, m$ d# b- N. O
Cookies(cookie)(key))   
% r' p5 z8 ?5 J5 Q+ y, ~! U3 v   Next
9 i( V& F6 G  H& K' K   End If & @8 A( j5 ~" {* v6 J! }" O
   Next </P>
7 d, ]7 z/ _  U+ ?& v<>   tbl = MakeTable(tbl) & I( ?8 s( Z+ D; m" S# E* |3 c2 h
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
6 Y9 ^$ z! }# H/ t; _- r   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
9 i! q# V5 \! b6 K   Response.Write replace(tmp,"|", vbcrlf) / ^0 D3 E# d$ C, }
end sub
- s: X. Z$ ^' l/ k  & j2 Q8 i, M- i9 I/ K& L/ `4 w
'*********************************************************** 0 B( C+ {; a) {, j
'* PrintSummaryInfo 3 C$ R. a1 N/ o* s5 L* N# y
'***********************************************************
2 U3 E5 z+ n  Z& e# B. |Private Sub PrintSummaryInfo(byval DivSetNo)
$ }$ P/ h; b1 r   dim tmp, tbl 7 Q- b' G+ Z$ m! t& ]  q. }! n
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 0 o" t$ o5 o! K/ {" l
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
  d1 p; F8 L$ L0 x/ P; U9 e7 X   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
0 ]/ p* I- F; E1 n( i2 {: y   tbl = AddRow(tbl, "Status Code",Response.Status) # w0 T/ f# D" b( q0 R3 q
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) 6 e- |1 c, {' t% ^
   tbl = MakeTable(tbl)
' `+ R4 Q% ^: V/ e( y/ G% @   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ; @% w. z0 Q* g* [
   Response.Write replace(tmp,"|", vbcrlf) 8 B6 e$ m% D5 ]
End Sub </P>
" A+ x1 r% Y) w; v% C( r/ o<>'***********************************************************
1 B8 v1 T  S( T3 B2 F# d''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information   ]& r. c- T/ ^0 r0 ~1 B0 v
''@PARAM:  - oSQLDB [object]: connection-object 1 @, j/ h+ V* W  O
'***********************************************************
$ N2 T; g. p8 p. l4 R' v/ BPublic Sub GrabDatabaseInfo(byval oSQLDB) & V8 ~- x1 S) y0 X) [# H( T5 m  g+ E# s
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
1 J4 p2 F5 {6 l   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ! H, q: Q7 J/ i5 N" K1 o5 C0 [
   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")) " B5 c6 M0 d. U4 k, p6 g4 U9 R$ {* V) ]
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) $ ~0 u$ t! V8 Y- C2 }: q$ h; y; |
End Sub <>'***********************************************************
6 e0 R: P4 ^. G'* PrintDatabaseInfo
! c5 C) n5 h. \) E1 \'***********************************************************
# Y& T1 w' m; P, T8 V1 ~Private Sub PrintDatabaseInfo(byval DivSetNo)
' @: ^% ?2 W; D4 [! `   dim tbl
: Z! N7 y7 A. F, Q; E5 r   tbl = MakeTable(dbg_DB_Data) ! {3 j1 m0 x) q) O: S* u
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
( ~# R1 y* M& n% K% H( b   Response.Write replace(tbl,"|", vbcrlf) 6 _( h8 y" c, F1 b/ X( d
End Sub </P><>'***********************************************************
% s. J& F1 F4 k5 n: ]'* PrintCollection
' @- z% V2 Q- h( {. l'***********************************************************
" {! F. J9 o3 GPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
% s! P- a  u" ^5 l9 [   Dim vItem, tbl, Temp
$ z& Q. F% _" W  H% ]5 {" W   For Each vItem In Collection 4 O6 U$ _* v! o3 k
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
; l7 ~/ h0 Y# e0 l4 }8 h       tbl = AddRow(tbl, vItem, "{object}") . I0 B' z9 o4 l* Z7 I& ]- s
     elseif isnull(Collection(vItem)) then 8 X: \8 z! n- P8 S1 o: k0 a: Q
       tbl = AddRow(tbl, vItem, "{null}")
  Z) z( T  E, V     elseif isarray(Collection(vItem)) then   ^9 Y8 \, U7 g3 Z8 m  r
       tbl = AddRow(tbl, vItem, "{array}") - ]- W6 |( Z+ F* f% l' I
     else * I8 p1 \/ x7 }  m
       if dbg_AllVars then : D1 i" Z2 n5 U7 u+ h
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
: h, i# k* w* A$ D0 O# k4 G     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
/ X% O! Z  Y% I       if Collection(vItem) &lt;&gt; "" then + a. r% x- q1 d" d" T; G
       tbl = AddRow(tbl, vItem, server.HTML  Y* n# t$ n+ v+ i& R0 g/ e
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") , V# A- s% g' j0 o5 Y0 b1 \
       else
* K3 p: l+ A. f8 K2 a1 h       tbl = AddRow(tbl, vItem, "...") 3 ^2 I- B/ o6 v, F' g& B
       end if $ k4 x+ \  ~8 X5 e! C' Y" n
     end if 1 Q( q9 t: a4 \
   end if 1 i3 l6 a; Z% K7 |7 {
   Next
" I% t$ t8 I8 s9 J   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo : W4 h+ E) Q/ o
   tbl = MakeTable(tbl)
) T% ~( _# m  D/ B2 R$ Y   if Collection.count &lt;= 0 then DivSetNo =2
, j  L6 M! p( K, P4 A1 ~* ~3 R, s$ F" C     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ) q& ~' d- N7 b$ g" u7 G# K
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))   k0 {2 O. K5 Z
     Response.Write replace(tbl,"|", vbcrlf) " d0 R0 s. l) T2 M
End Sub 5 u5 [0 M' V& T
  0 A5 k# I- X- C9 }) \4 M; A) N8 ]
'*********************************************************** & U' _0 Z5 ?) i$ t
'* AddRow 8 c: i: j0 E4 ^* \
'***********************************************************
! u; a, o& p5 c) ]8 UPrivate Function AddRow(byval t, byval var, byval val)
% X  e3 I" k0 E7 c7 k7 y9 k   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
& K1 z1 V( O% ?6 R; }) E2 P   AddRow = t
) u; e2 K, b* }5 z7 K3 iEnd Function </P><>'*********************************************************** 5 a% |0 i" W3 [0 e- P( f5 ^6 r
'* MakeTable
: N! F9 Z/ j5 `4 o'***********************************************************
8 R: p' K$ r4 `" R& x  IPrivate Function MakeTable(byval tdata)
+ O1 R: t6 r5 }" X, G$ e: M& L9 m   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
  v1 {  o% Y8 m8 k$ S1 b- y2 q   MakeTable = tdata
( E" r6 \+ Y5 I% S' s6 u0 pEnd Function </P><>'***********************************************************
0 |! x* G3 g3 l& t4 ^" M''@SDESCRIPTION: Draws the Debug-panel
' U6 d# D. Z( ?* h! @& n  M2 f$ Z'*********************************************************** / y% @7 R- y: F8 A, z5 @4 Y$ ^
Public Sub draw()
( G( `9 V# @7 N5 b3 X   If dbg_Enabled Then
5 C2 R- Y+ H8 d) Y     dbg_FinishTime = Now() ( |# E+ j  Z: O4 g4 J, }
  
' K$ T2 o$ A8 l2 |- ]: \' ?5 e   Dim DivSet, x # T/ m# `% H; I. G: W
   DivSet = split(dbg_Show_default,",") 7 p' ?/ V; h% P4 B+ c) p) e
     dbg_Show = split(dbg_Show,",") / ?2 h1 I* g6 e/ _
  : t# U: p3 a0 r; @- j& j
   For x = 0 to ubound(dbg_Show) # I& E! B' [5 n8 a
     divSet(x) = dbg_Show(x)
, n8 R0 v( P% h* K3 f) E9 [$ i1 [   Next
# E9 L1 X! T+ D3 y6 `  
7 W% Z3 N4 S1 Q/ \) j& C& C5 j: J   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;"
$ r8 K; U9 h" p' n8 |) I9 I; Z   Call PrintSummaryInfo(divSet(0))
5 p7 t$ {' O/ R  h* ?# J3 _$ r' X     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 5 ~4 \8 a: E9 t7 Y9 u; ?; ^
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
; V8 j% [5 T- }$ }    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
  e! c* f9 \" S/ `6 h' f! J$ B    Call PrintCookiesInfo(divSet(4))
& i& B$ t: m4 l. T7 ~6 |: m    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))
# O6 q, _4 u1 g    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
9 ~% m4 D* \- V2 @# z    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) % i. \5 D, ]7 Y- t4 O0 s8 i
    Call PrintDatabaseInfo(divSet(8)) - D9 W: m3 Z. O$ G7 ~( L
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 6 }! F0 v( z2 Z0 V; c5 C( @# H
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
! M$ m/ |, j$ x8 P4 R    Response.Write "&lt;/Table&gt;" 3 u( d* C: Z, e/ K( g9 Q5 U
   End If
) ^" w( d' o/ U8 I- x) R( wEnd Sub </P><>'Destructor 6 V7 O1 a4 A: m( N; T6 E$ N
Private Sub Class_Terminate()
  y; n4 {$ N8 z% R3 x* h   Set dbg_Data = Nothing
- w  b8 c. o' q. k4 yEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>2 Q7 R  E2 C5 V& u" q% [+ n2 Q
CLASS debuggingConsole 7 b+ A$ l8 F% e2 U, ^. T8 O6 x3 X6 O
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
8 S$ v' y/ l$ e+ U1 d  u5 X&amp;n. G: d, {6 U. W
bsp; " H- N  e2 o2 w- l3 D
Property Get Enabled===[bool] Gets the "enabled" value 1 p) W( B: h# P
  
+ s) [: D6 S' W4 DProperty 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 % X4 v2 T6 Z4 `: w
  + D  v  j$ `  F, n
Property Get Show===[string] Gets the debugging panel.
1 Z" Z" V- `. f  & ^. z. Y9 V9 k' w  ]- z+ F
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><>-------------------------------------------------------------------------------- ( d4 h2 T- p3 q, U
Public Methods </P><>public sub===Print (label, output) 1 k9 [$ g0 x1 C) O
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
/ ~$ P7 g' o- M+ d   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
6 j1 t  K' v8 r" D8 m5 f   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
4 `  R9 }- E  \Methods Detail
0 a" F) H' [8 D7 O  
3 |2 h) k4 h* F% S/ v  |3 wpublic sub===Print (label, output) ' s4 }1 _) B* S- p: d, i7 n# R
Parameters:  7 `: e2 H8 y. j& y8 M
   - label [string]: Description of the variable 8 C0 ]  ?( k; h* T# _! @3 a
   - output [variable]: The variable itself
. A0 w3 C/ ?. R) E. I; A7 ?. `  
2 n! q! Y2 D6 a/ Cpublic sub===GrabDatabaseInfo (byval oSQLDB)
9 Z' [! q+ y- R  N- ^8 r* V& qParameters:  
, J0 ^; G3 I& c; Q5 v' u1 k   - 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, 2024-5-7 22:32 , Processed in 0.672491 second(s), 56 queries .

回顶部