QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>- z# C  L2 a1 u4 V( V7 f$ f
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ) G" m  ~) A5 `
使用方法很简单:
# J, ?( d5 K) P0 X. Y, atest.asp </P>
  z* a9 b( g. o* f' q# B3 L; E<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
7 Y0 R; N* b# O: h3 i6 g- m&lt;% $ X& }% @% a3 }  w! I/ G
output="XXXX"
  L1 Z7 Y7 M6 |# j+ c. p) \. cSet debugstr = New debuggingConsole 5 }) I# y1 C. q6 N& [
debugstr.Enabled = true 6 [) u9 o6 p8 r4 S% y! W
   debugstr.Print "参数output的值", output 5 {* a! N$ s$ l
   '……
) j% _; d" y( Y0 r   debugstr.draw ( ^0 w* R( ~5 c6 ^( C
Set debugstr = Nothing
. P. U+ b8 A4 y& V0 L3 [% X%&gt; </P>6 H9 [& W- H% l" V" t5 L* ^- S
<>=================================================== </P>  A# i2 j' F+ t5 B$ X
<>debuggingConsole.asp </P>
' \0 Z# N, a7 S/ g5 P( p/ O6 g% _<>&lt;% 5 k( @8 t8 O- \' m
Class debuggingConsole </P>
. I! W; m9 v6 l5 t1 e0 R<>   private dbg_Enabled & y% a/ t' Q) H4 K0 F9 \% Q+ F
   private dbg_Show , _8 X1 r0 G  @' v! I6 |
   private dbg_RequestTime
( o, o2 W! s# x/ r, H) s) U   private dbg_FinishTime
( P  ^$ G- x6 G9 d! ^- \   private dbg_Data 6 F" O$ O: U* X6 L
   private dbg_DB_Data $ l% b' \, \# D: k( f
   private dbg_AllVars
& p( L* m* s8 a8 f% U. m   private dbg_Show_default 6 C" n# D  b+ s
   private DivSets(2) , \% J8 g0 r4 ]. t: H
   9 L$ T# f) {. b/ s( s2 r* }$ N
'Construktor =&gt; set the default values 7 ~4 z7 _4 ?8 N# D4 ~  a! Z
Private Sub Class_Initialize()
" n  j. J0 A8 Z3 v   dbg_RequestTime = Now() $ g$ c( c+ a6 u7 F! |) w! e
   dbg_AllVars = false
' T5 ?/ j+ o8 @" s   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>/ w; R: o0 R" t' s5 O2 O$ d
<>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>
9 l- M! w  t' ~  m7 A<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;: ]- d; @/ j# P& i  z) `# m
&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>: w) l4 Y4 a! R, c
<>   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>  O: P& E2 B% H/ p& Y% |! L, s$ R( z
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
$ ~8 [2 R- |  H' T5 w4 HEnd Sub </P>7 @. P& `. B, ~* o: E+ O
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
, R9 B5 }3 a' X% M# G% d: Q   dbg_Enabled = bNewValue
" T. L8 z+ |2 A+ G4 z, ?, xEnd Property </P>
: H% D/ B# `: E- g( H, {2 r<>ublic Property Get Enabled ''[bool] Gets the "enabled" value ; @& u9 U9 Z9 B7 C" }
   Enabled = dbg_Enabled
3 D3 `, W- ?% ?: w- t3 ?End Property </P>7 G8 n$ Y# X' N4 ]
<>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 d7 p, ]" t& W- P" h4 h5 @; z   dbg_Show = bNewValue
& v7 k( e% V# \* g5 tEnd Property </P>6 J0 J6 ^2 c: O: C$ W9 Z. M
<>ublic Property Get Show ''[string] Gets the debugging panel. ( _! a1 F* I0 j4 c
   Show = dbg_Show 4 j6 t' a6 n( K: n- y$ L
End Property </P>: ~8 U- F2 f7 p# M
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
- H, f! H& w% y0 p6 |. h( e. W   dbg_AllVars = bNewValue 8 h( Q5 D; q* a4 p" l$ G" n! I
End Property </P>, }  `7 E7 f0 t1 @9 j# M5 N6 `
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
) Z0 T' V" j# U- C+ \0 y9 e0 G8 {   AllVars = dbg_AllVars
) R# M( O- l4 j$ [% o; QEnd Property </P>
* @) ]( P% ~$ p% }" G" u! D<>'***********************************************************
) @* m" S4 A8 ]& ^1 V* b& u& t7 F, ], Z''@SDESCRIPTION: Adds a variable to the debug-informations. ( E+ N9 L/ j) |7 x" r
''@PARAM:  - label [string]: Description of the variable 7 }  B) I* T" \8 f3 h* j9 J* {
''@PARAM:  - output [variable]: The variable itself
2 _5 Z+ c3 w0 ^7 y' w5 s'***********************************************************   Y) F7 m; N# w: Z. |8 R
Public Sub Print(label, output) ( g# U3 i2 g8 b9 T# y) Y8 i: }) ~
   If dbg_Enabled Then * F% \( u1 r' m
     if err.number &gt; 0 then
& z8 `! u. J9 W- V8 o. A       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)   N4 h' p) v+ `' L5 h* \% d6 _
       err.Clear
+ ]8 p. m- U6 w* q. W     else 8 [$ {* r  A1 a- u$ e/ A6 M: L6 r; N
       uniqueID = ValidLabel(label) % W6 F) G5 n7 G4 H$ s3 j
       response.write uniqueID
) [' `. F; ^8 I& t       call dbg_Data.Add(uniqueID, output)   q1 W/ [& {; g5 _# ?& y
     end if 5 h: j7 |4 |. h  A. r9 [
   End If
4 \3 \- x8 h# w( T% A7 cEnd Sub
. t" ^6 G' p+ Z  1 o/ Q, Y8 F- H/ k5 Q' X( T- f
'***********************************************************
7 X$ I5 V) k3 y+ w'* ValidLabel # G; e4 H* l/ I. t1 t' Z+ R, j
'*********************************************************** 5 m% `0 t: A0 @) w2 ?
Private Function ValidLabel(byval label)
& U% e+ Q  z" c4 {. N$ F0 f   dim i, lbl 0 L, X9 z# T# `' B4 {( ?, O4 }
   i = 0
% t4 B. j" s. ]9 i   lbl = label 2 r5 C( b4 w! N& F+ _" q
   do 0 A% V$ A" ~( w! N
   if not dbg_Data.Exists(lbl) then exit do 6 o+ V/ g' ?: \2 ]9 |& p
   i = i + 1 7 ?' S7 O! R7 `4 t$ B2 ^- Z
   lbl = label &amp; "(" &amp; i &amp; ")"
8 z+ t+ f2 R& F/ B- {( T/ B8 h( u   loop until i = i
! X* }. A. t! D1 X: z  
* Q6 {1 ~/ [: U; C9 |  t  X   ValidLabel = lbl 5 Q2 n- \2 @/ ~$ i5 A) d
End Function : V: D2 s/ N1 Z* C, S
  
3 P" [7 F4 |: u; s# C8 {2 K9 {'*********************************************************** 7 \) @( z6 j2 d
'* PrintCookiesInfo 8 P  V  H& |. w( L, j: I& h( _
'***********************************************************
  C, T# \& z6 QPrivate Sub PrintCookiesInfo(byval DivSetNo)
9 E% I% f$ S  ?   dim tbl, cookie, key, tmp
: Q, f8 i  u4 ~% L   For Each cookie in Request.Cookies . F& F- i3 O/ y2 E) P
   If Not Request.Cookies(cookie).HasKeys Then
$ d3 q! E: j5 Z/ ^     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ' \" E6 O9 a3 W' C/ U$ e8 }: Q
   Else 3 c( S# v2 q- U; ^6 g$ o6 b
     For Each key in Request.Cookies(cookie)
# o/ z  X6 i$ f: a3 q, M4 ~" Y     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 6 l: D. w7 c. A: ?- ?" z7 w
Cookies(cookie)(key))   / g) W& c0 E" A# W/ `+ o7 X+ ]% m
   Next
2 Y  W$ O, @+ d+ h/ x5 ^3 o. Q4 U   End If
$ d7 ]- G& `; J: I" \8 k9 R   Next </P>; U. v0 ~( z* Y" `7 F
<>   tbl = MakeTable(tbl) ' a- B1 v: r4 ?1 {; s+ o+ J4 r( v7 T
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
4 K6 \, [  c/ S/ L: A   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
6 ~6 b# Y- R9 J! Z   Response.Write replace(tmp,"|", vbcrlf)
; j3 @2 D4 ^% y0 ]7 qend sub 3 m6 R/ a. i4 o/ R
  
9 f' Y: K" ~9 p2 v4 U6 h* s" O* c2 N'*********************************************************** ) Z) U. j2 U0 x8 S- _# o
'* PrintSummaryInfo 6 k% H: B- X5 C5 _0 u
'***********************************************************
( ^: [. H5 @+ k. QPrivate Sub PrintSummaryInfo(byval DivSetNo) $ S2 Z% V) @) q7 K+ `7 k
   dim tmp, tbl
% u1 j( B& ]6 H5 v( ^: g( }   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
# a3 I* x" r& V   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") " A; u$ J8 ^; d) }1 _, e
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) 7 k- G# r! t' |
   tbl = AddRow(tbl, "Status Code",Response.Status) 7 ]5 _8 L3 Y* T! [) S0 z& _2 Q5 }6 }
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
% B9 r* {& A3 a/ B) b   tbl = MakeTable(tbl)
# s/ k9 n2 k( x8 [& ?   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
( y/ y1 J# s) m2 |) p; }% w   Response.Write replace(tmp,"|", vbcrlf) / T' Z& _: R. h; J
End Sub </P>
5 q5 p" z. H! ~* ?* N<>'***********************************************************
( x, c; c4 V' Z5 `4 Q/ d''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
/ E9 ~: i# @2 S( [1 d. Y. {0 y''@PARAM:  - oSQLDB [object]: connection-object
  I- i4 x6 ^! z'*********************************************************** 0 G. M* Q& O: h" E. j% e
Public Sub GrabDatabaseInfo(byval oSQLDB) / M% h; X5 w. l$ y
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 5 p% T( u: d4 d& y" y
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ! W+ S4 T4 u; e
   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"))
- a$ f3 W5 i9 O+ s" Z5 h   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) " s* ^: q4 {! a  }5 _
End Sub <>'***********************************************************
) O$ E( ?/ }8 g- g6 J, t( X1 A% l'* PrintDatabaseInfo
5 l! _9 J" Z9 i0 p/ p. V" R+ j/ L& N'***********************************************************
( `' a- E* o8 {$ l$ j5 I- f8 ^4 pPrivate Sub PrintDatabaseInfo(byval DivSetNo) + x$ V1 A. m; S# ~
   dim tbl ( L. _, b+ X8 p4 Y3 s+ C
   tbl = MakeTable(dbg_DB_Data)
8 H0 ?3 r6 j  a8 f5 e* u9 k, y   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) - j) z3 G5 X/ y. A8 Q, d5 h6 S
   Response.Write replace(tbl,"|", vbcrlf)
% A2 B* A3 a4 iEnd Sub </P><>'*********************************************************** - r  c' _$ u# b7 V5 m# t2 [
'* PrintCollection
' ~: p2 [" n" z5 r9 L'*********************************************************** ( n: z6 R- R3 c- ^2 h+ `5 O7 s
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ' n* Z3 v- F# ~0 r8 B! a4 f
   Dim vItem, tbl, Temp
! J$ k6 l" [& Q9 C* l: x( W   For Each vItem In Collection
$ t1 F) r! F7 s$ m7 S6 g% I     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
; r8 U6 A! n7 x) o5 Z' x       tbl = AddRow(tbl, vItem, "{object}")
& {  ?" d  w. |% G0 c     elseif isnull(Collection(vItem)) then 9 W4 P5 R) c# ]3 ]2 d4 f6 r
       tbl = AddRow(tbl, vItem, "{null}")
. R) S& c0 i. y     elseif isarray(Collection(vItem)) then ; p$ K' }/ i# o0 m0 O
       tbl = AddRow(tbl, vItem, "{array}")
1 \3 B2 a) K* O7 T  M5 w  p     else / |) L2 F4 K4 M
       if dbg_AllVars then
' a: ~, m9 `6 L+ q# k       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) 7 _( W+ j" B; ^. G( n
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then % l$ v& f+ C9 e, M3 |0 S
       if Collection(vItem) &lt;&gt; "" then 9 `, Z) P! |' [$ ^4 ~) M) _. R; _
       tbl = AddRow(tbl, vItem, server.HTML6 l; W7 ]' y( o7 u6 m! B& e; V
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
: X4 c( _0 d# M       else
/ s7 n# |9 b; {7 z$ W1 w. Q       tbl = AddRow(tbl, vItem, "...")
& y) D7 d% I% Z9 ~       end if
1 E/ m( p+ G' n8 }3 A5 p     end if
! n8 M3 `2 a5 e8 E. e6 p( D   end if ' [1 Y6 a6 J1 C! ^
   Next
& ^8 B$ b% x8 }   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
0 g* e2 P$ A7 U   tbl = MakeTable(tbl)
# p9 M: z2 m- K+ F( ?   if Collection.count &lt;= 0 then DivSetNo =2 : a1 t  V- X! N* C
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) * u, t6 d+ z# s4 W8 e
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 7 T7 K& e$ T$ J+ Z, k5 D" S4 i
     Response.Write replace(tbl,"|", vbcrlf) % H7 _: h7 I( p- p
End Sub
9 A$ ]$ ^- b/ m. r. Y7 n) k" G  
; C% D/ u$ Q8 X- r! @'*********************************************************** & `/ x4 m, x) w3 g
'* AddRow
6 j2 o7 w+ P! k& C3 p; I'*********************************************************** 3 A7 }* l  Z1 u9 r) I/ L
Private Function AddRow(byval t, byval var, byval val) : R! I( Q, N( Q7 `& _: K) r8 e
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
7 M- e% E: s1 ~- C- T+ b; |& C   AddRow = t
5 v% J/ t0 `: T5 J. ]End Function </P><>'*********************************************************** , K7 a  c; j% S$ H, p% r9 \
'* MakeTable
1 m$ y- W1 e* H# }1 t3 q'***********************************************************
; x6 l6 O( H% t+ DPrivate Function MakeTable(byval tdata)
' a2 Y+ N$ }  \  D' E: Z* X% t  w! Z   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" / u1 S* Q( d5 z0 ]
   MakeTable = tdata
0 z  d, L, S* G5 [  OEnd Function </P><>'*********************************************************** , t8 h2 S8 C* ]
''@SDESCRIPTION: Draws the Debug-panel
8 l6 d8 v8 Q3 A1 L5 u6 \'***********************************************************
* _# \- M$ E6 ?6 g8 }5 FPublic Sub draw() $ N) _+ P0 T* a
   If dbg_Enabled Then
3 J+ |+ N! \: F6 N/ t# G     dbg_FinishTime = Now() & d5 n" z7 C- s+ n  A( n! p4 ~
  
/ Z: T+ G! _0 X+ }   Dim DivSet, x & @  x4 h  {( x! ^  M* j* _) }, \7 k5 m
   DivSet = split(dbg_Show_default,",")
/ z6 O( J7 i9 }6 F     dbg_Show = split(dbg_Show,",")
' @3 W5 i7 Y; `& \+ G0 V  2 K. e; V* y2 K9 ^. }6 S3 I
   For x = 0 to ubound(dbg_Show) 2 N% I5 T/ {6 o3 ?1 {/ w! d
     divSet(x) = dbg_Show(x)
! Q* H- p2 D) ]' ~1 S   Next
) j7 b0 [) ]& A8 A3 y. b% F' h! [7 I  6 w8 i: v1 b0 o) \$ _
   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;"   {0 @7 a% Z, D4 ?8 t. t
   Call PrintSummaryInfo(divSet(0))
2 l- H9 b+ B7 q     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 4 Y1 s" f7 n& c- O2 J% ?9 s
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
0 X* J' B+ ?, G6 [    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 a9 U+ q0 K/ E9 t9 n    Call PrintCookiesInfo(divSet(4)) . y+ f- g- P2 A0 H+ {
    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)) + d' M% `9 E+ H; G. L
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
/ V4 t! |9 r" O, e8 H) _    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))   ]# S1 Q* p# }- q% ~! H
    Call PrintDatabaseInfo(divSet(8)) 2 m0 E  `7 R5 u3 m
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
! L/ z/ W, a9 a, Q    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")   r1 v7 r" `% x6 _$ k
    Response.Write "&lt;/Table&gt;" , b+ L! q) c$ z8 k6 Q
   End If 8 |: Q( m' r. A4 r+ j4 h! |  f
End Sub </P><>'Destructor : D: i6 M/ F! u. n
Private Sub Class_Terminate() * ]% ^" x" ?% [- x
   Set dbg_Data = Nothing ! s( F6 R. H/ o# H) v2 f
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
% @% F7 G: R1 O0 H- yCLASS debuggingConsole ( v$ p( W7 ~: L( _! ~& _" @- A) ]
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
9 O+ e, U1 F% l' k  R. X&amp;n
+ ?+ G1 P: Z% w, Pbsp; % e7 C4 s/ }) Z* O& @% `5 o
Property Get Enabled===[bool] Gets the "enabled" value
' @0 V+ u. W5 m7 a2 ?, m) o/ e  8 G1 }5 n0 o5 z9 K$ I& x
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 / Y* i% h# R* z# q0 S( T7 U
  8 O& s( `2 F$ r. @
Property Get Show===[string] Gets the debugging panel.
9 Q6 o; H* k5 s  4 J1 N# ^6 j% t( a; s$ ?, i
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><>--------------------------------------------------------------------------------
. d+ n5 b$ v0 T/ OPublic Methods </P><>public sub===Print (label, output)
, o. D/ U' @8 f   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
7 e4 s: q" R# f3 V% E4 c/ `& H   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
& q' U" @# E2 q% O' S: u. u5 N6 \   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- ; I, p; \4 h/ q& |8 S* Q
Methods Detail , }6 w2 q% T# A5 a$ C. x& B
  * J- S# H: a( b# D
public sub===Print (label, output) 1 Z- ?2 r: X5 w! P- V- [, B6 @
Parameters:  
+ m% D' n5 f3 X; C4 M4 g7 P   - label [string]: Description of the variable * P; Q/ Z5 T8 T; o' ?
   - output [variable]: The variable itself
5 v7 d7 ?1 ?6 V7 N  {% K" D, U  ! O6 h/ h  Z" K# h+ `
public sub===GrabDatabaseInfo (byval oSQLDB)
& k% @3 B2 }$ E' IParameters:  5 `. `2 p0 @! n# A6 E5 t% o
   - 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-11-8 05:20 , Processed in 0.797970 second(s), 56 queries .

回顶部