QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
( w5 f$ q* r; J. L% |<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 8 ~6 r' |6 E' e) a9 D3 r& R) Q
使用方法很简单:
9 h. N, ^* L# Q/ vtest.asp </P>
( V# a, p1 x  C4 G# r6 i9 l<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; + B% `3 V5 X( i$ T6 f
&lt;%
; ^* }/ d0 |) }output="XXXX" 8 t( M: z6 Z9 c: Y! x# y5 h- _3 S4 Q
Set debugstr = New debuggingConsole 4 K* i. m3 f5 B
debugstr.Enabled = true * P+ r" v: A5 ]+ {  S, y
   debugstr.Print "参数output的值", output " L1 a& F1 ~0 E  W9 Q$ C3 T
   '…… . [, I' [0 u7 ?- a. e( g
   debugstr.draw
' J) b% g5 c7 }1 n4 t: h2 vSet debugstr = Nothing
' I# S) v2 `7 W%&gt; </P>
# H& `* L/ x* [& |6 r" f% x<>=================================================== </P>  X" j0 o# o, @2 y3 s& a
<>debuggingConsole.asp </P>
$ a4 \1 G5 X) e; x. q1 m0 ?2 C: r<>&lt;% 6 L. W4 i- L! H, g4 W8 j$ B
Class debuggingConsole </P>& {9 X% z3 ?2 }* A/ c
<>   private dbg_Enabled 5 u' U; o# E( b
   private dbg_Show 5 k6 n- m0 x# Z, |& Q: H% Y+ o
   private dbg_RequestTime
) \( G- x6 u+ b3 ?   private dbg_FinishTime . a: ~, w( ^7 r6 q' {3 V
   private dbg_Data
8 r' b. y; N! ]; }, b   private dbg_DB_Data
0 D6 t; z  y" w/ S   private dbg_AllVars & h% o# j4 t5 m2 p& X
   private dbg_Show_default
7 W, R; B, q& S0 d3 C+ ]   private DivSets(2) ( H6 F, s% x/ ^1 h1 w" N/ w
   
9 k+ `; I- Y  P/ D/ K5 ?( S/ s7 r'Construktor =&gt; set the default values 0 m, [! `6 s& Q/ A8 j8 Q8 ^
Private Sub Class_Initialize()
# u  h/ B0 V4 |- I4 ]   dbg_RequestTime = Now() 2 a1 N; d# z1 D% {" u: C; \3 h
   dbg_AllVars = false
2 W0 H; d6 s% {, @. N1 i- u   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
  d4 O+ P5 g# n( _( ?/ y<>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>
( h- A& c% V1 n/ R6 ]<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;( y% A' Q5 n9 Z) }1 E; 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>
# R7 A4 ]+ I0 e# P& Q0 y  O5 r2 y% ~<>   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>
0 Y& y. A. x$ g; e# E3 X# p2 |<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" 5 o4 v1 P- Y" R7 D+ W1 J8 F- A
End Sub </P>
' @: y+ v  w) \0 o: g<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
& P& P8 z: g- q" y   dbg_Enabled = bNewValue / l4 o+ T$ I$ H7 D; t5 \1 K2 P% E
End Property </P>
/ D- e* }- L5 z4 g/ p. v7 t& j4 k<>ublic Property Get Enabled ''[bool] Gets the "enabled" value * Q7 e, h$ U; E* N/ s4 z( v
   Enabled = dbg_Enabled
8 C' t' ~+ {, SEnd Property </P>
- X( r4 b& \1 x# U5 v<>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
( s* x7 e1 G$ o/ {7 \3 l   dbg_Show = bNewValue 2 u5 i( u5 p) x
End Property </P>
1 [+ @( L9 x- f2 }- @<>ublic Property Get Show ''[string] Gets the debugging panel. 2 s; L0 Y4 }2 [5 H( M1 f. r
   Show = dbg_Show
, V& a! c  j' h; n5 ~+ w' y8 e5 B/ q. e+ ^End Property </P>8 e6 S& L2 W$ @5 T2 G$ `
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
0 m0 w: G2 X) b; X9 W  b( _0 w   dbg_AllVars = bNewValue
0 V" }" J1 j6 w8 V$ vEnd Property </P>% J7 I! |' `- i) a+ ]
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
* b+ C5 `7 e- X8 t! _   AllVars = dbg_AllVars
2 P8 Q8 v8 [2 T" |End Property </P>4 @) G# Y0 c, ?: ]
<>'***********************************************************
: E" F& j- v# f; O% |''@SDESCRIPTION: Adds a variable to the debug-informations.
- P9 }- W& U: }/ f$ o( \+ z3 c''@PARAM:  - label [string]: Description of the variable
7 D% d% F; [' D5 P2 \* y''@PARAM:  - output [variable]: The variable itself
+ _- A$ p; k7 d4 ], W/ y'***********************************************************   Q8 D! m, e, T, a7 a& I% s0 c
Public Sub Print(label, output)
4 O* ]. R1 C+ \; V+ Y/ R6 Z, W   If dbg_Enabled Then
: u( q  x, j  M! D: q     if err.number &gt; 0 then
* P+ N+ X* \5 v: X8 l6 C       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) ( |# B/ j) }! x3 e& n4 u* o  J
       err.Clear & y( H7 U5 @: @) y( d
     else 1 A( X' j% D! T+ R& S7 O' b
       uniqueID = ValidLabel(label)
3 C3 g# o8 s, M6 q! F4 P5 m       response.write uniqueID / [* A4 ^3 V/ I; [. ^8 w; }" o
       call dbg_Data.Add(uniqueID, output)
( ?4 w4 n" c3 k, z     end if + b8 |4 g. k; A4 Y
   End If
) T. c) F6 p% E$ ^- W8 QEnd Sub
) x* e9 o5 d8 r5 n- v2 ?! I  
$ y6 }& O0 A! O: B+ R: }/ E'*********************************************************** * \3 H  O( w7 T
'* ValidLabel " }  ]& T9 s  R1 T0 B
'***********************************************************
2 z8 A1 h* S; s, J2 h# N/ zPrivate Function ValidLabel(byval label) + V6 s$ S2 z: E. X9 Q: {1 w% N
   dim i, lbl * k, K2 y' h3 K' U. L7 v) m
   i = 0 2 P5 x- H/ |( j+ S! O- r7 Y2 a  V: |
   lbl = label
4 _! u" u: h' o" Q( V   do
) z% P! G+ {! r! Y   if not dbg_Data.Exists(lbl) then exit do # j+ p/ k; L: a: i! }6 J0 d1 d
   i = i + 1
5 A9 o( m# ]; O   lbl = label &amp; "(" &amp; i &amp; ")"   q9 z% h3 c+ v
   loop until i = i 9 Y$ ^7 C; E4 c, \2 P9 k% f' z. m
  
% X. I6 [/ _+ V5 C2 Y* _* {8 U   ValidLabel = lbl
, @+ z' u  N) K  Z' uEnd Function : @- ~2 v0 h0 j
  
* O* R, H1 x( ?  _) o2 l% T$ r'*********************************************************** 7 \; I8 a2 w! A0 U
'* PrintCookiesInfo
5 K6 X) p8 X& {0 g'***********************************************************
! q& X8 ]! m& a! gPrivate Sub PrintCookiesInfo(byval DivSetNo)
* H+ R; O0 b. h3 C5 w, t   dim tbl, cookie, key, tmp
+ d0 F: e5 k) `4 q" O/ N9 M   For Each cookie in Request.Cookies
7 |* B" l* C# G% B# m, G3 T$ l' G   If Not Request.Cookies(cookie).HasKeys Then " W+ I/ Y2 ^8 y# l
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ( w5 a4 ]2 u0 M9 z! @4 w
   Else
4 A' x, a* G, n" \+ c" ^5 j     For Each key in Request.Cookies(cookie)
' a# s) m6 Z  J2 n& w' h) \2 p8 c) D     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 8 e& U' @2 D: B1 E+ z
Cookies(cookie)(key))   
9 S' S. A* |6 p$ d/ G5 M   Next
* t# y1 H6 I3 u1 n6 y6 z* Z   End If
9 F2 o3 U2 ^( B4 z  J3 S   Next </P>
& b8 [. a8 v! m3 p<>   tbl = MakeTable(tbl)
3 ?- A$ b5 k4 p' m, p   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 " N. f2 R. s: G+ T# F0 x& `
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) ( R$ d+ Y$ q/ k5 ?
   Response.Write replace(tmp,"|", vbcrlf) 9 ]6 p: K. g1 _, A
end sub
6 n( t# i/ l! z5 ?4 ~1 m0 [  
( L- y- |$ B, z" J'*********************************************************** + c4 D+ u$ ?& W2 s" ~* B" e$ Q- @
'* PrintSummaryInfo
. z( }/ k# i3 E& `4 ?2 |! E'***********************************************************
4 i9 Z& W. f# n& l  UPrivate Sub PrintSummaryInfo(byval DivSetNo) 4 O) O. e) s* V# p
   dim tmp, tbl
" R- `, e: w8 t/ D   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
7 z+ }6 m8 e0 U3 o8 }   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
' v# h) A* p  w2 J8 J" |   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
9 U# H1 y% E; f) Y   tbl = AddRow(tbl, "Status Code",Response.Status)
2 b$ l/ e  |: j# y# g1 ^   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion) , b. n4 W) l  g3 S6 F! _
   tbl = MakeTable(tbl) $ y* N0 \9 U# k6 s& z
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 8 P) v' x" Y6 K  F2 A  }: }
   Response.Write replace(tmp,"|", vbcrlf)
, B' u$ h! E) n: uEnd Sub </P>/ I$ A7 c1 V7 H: d9 d! `
<>'***********************************************************
8 F  u  y/ |9 H- L''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
& l3 ?$ Q: d* D6 i/ o4 x''@PARAM:  - oSQLDB [object]: connection-object ) m+ x0 E5 d" C; a2 ?% {) D# `3 l9 h
'***********************************************************
9 I! v, a; m- i) q0 ~# ?9 hPublic Sub GrabDatabaseInfo(byval oSQLDB) 7 |( D0 j- x/ J- @1 Z" l
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
  @3 ^" P- w3 H/ I1 |8 ~   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version"))
' V; ]8 `- e9 ?. N   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"))
9 }0 |8 q0 B/ M   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
# J+ l% D" z9 HEnd Sub <>'***********************************************************
; a' o* K! \  E. g2 a0 C'* PrintDatabaseInfo
1 z3 P4 m% f- T1 u) D- q'***********************************************************
+ C- A- @2 C6 x: c! v& d! @Private Sub PrintDatabaseInfo(byval DivSetNo) 6 h5 N) V5 B0 h) i# I; K8 ?
   dim tbl 3 g9 Z2 c+ a0 U5 U: p3 s
   tbl = MakeTable(dbg_DB_Data) # W/ `) d  o% e$ u$ G/ h2 ?" T
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ) I, p" n' u4 ?
   Response.Write replace(tbl,"|", vbcrlf) 0 f. Z3 Q3 |9 Z3 o8 {# n
End Sub </P><>'***********************************************************
9 D( o: M- U8 B3 G$ V& P'* PrintCollection - i' O4 C, g2 }  Y7 h: P0 `' l
'*********************************************************** # d4 U* L% ~+ V# N% ~, Y2 T
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
) l0 f/ q, i3 U( x8 N   Dim vItem, tbl, Temp 1 M* f" o) Y' t6 q  a! c" [/ w
   For Each vItem In Collection , w' v$ B% b; P6 ?8 B
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then % H8 ^9 x1 n# k9 x. b8 _# w
       tbl = AddRow(tbl, vItem, "{object}")
9 a# V1 D4 {$ e" D- k! j     elseif isnull(Collection(vItem)) then
7 W) W* _  t6 z2 m/ N1 r" X       tbl = AddRow(tbl, vItem, "{null}")
7 L! C# n& C5 ~0 s0 _* U" ^     elseif isarray(Collection(vItem)) then ' o7 E$ v/ [6 d( X, F# n7 ~* V9 u
       tbl = AddRow(tbl, vItem, "{array}") $ o, X* {$ N* I$ L9 x
     else
0 ~1 A' O" J) s: @2 B       if dbg_AllVars then . q8 y6 j# |% F) \( q, Z
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) " ^# E* d; c: I5 }, J1 D/ F1 Y0 c5 G% Y
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then 0 C  W% W3 B% O6 e5 V1 s
       if Collection(vItem) &lt;&gt; "" then : O" C" K0 n; L: p4 i
       tbl = AddRow(tbl, vItem, server.HTML8 W# R" P) t: S
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
% H" A2 A0 }% X- v3 m       else
4 d- R) H7 a; J) M6 C% D       tbl = AddRow(tbl, vItem, "...") ; a& p) z  k4 \7 R* Y' {+ E
       end if , n3 O* N9 K& M# N$ z
     end if & f5 N8 a$ x( S* [4 `- s
   end if 5 q( U1 |: ]6 K, D- s$ [
   Next 8 }7 n" z: ~! B! G7 m% P; X: C5 ?
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
8 A( B8 l) d0 V( y% U" d+ s/ d   tbl = MakeTable(tbl) 0 I# O( ?! O6 |. }: @. t* x
   if Collection.count &lt;= 0 then DivSetNo =2 & U8 J0 g$ e: A/ j1 R6 c; l* x% n
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) / c2 O9 V! M. G0 \
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 1 @0 a& n0 {' m6 N* v9 {3 U
     Response.Write replace(tbl,"|", vbcrlf)
1 B- I. p# y! f7 T& w6 {End Sub
# {, S/ B% }: R, F9 w: Q  
  g; H8 f% A4 X" n4 O$ p. N7 j'***********************************************************
: m9 I8 O) e5 G+ ?. Y5 D* \) b( G'* AddRow 5 Y# |. y* W5 l
'***********************************************************
+ x9 f& f# @2 W1 y. n5 kPrivate Function AddRow(byval t, byval var, byval val)
+ B% c; a% r- [   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
! f) s! M: L- }! F# Z0 t5 C+ V" Q) j   AddRow = t
5 J& \9 o# y  ^2 L! _4 EEnd Function </P><>'*********************************************************** # D, f0 ~3 F# g. J; M
'* MakeTable
; T8 n; i9 K8 N9 S" g7 Q& b" e'*********************************************************** 4 Z2 V( Z# m9 A! Q( O" p+ Z
Private Function MakeTable(byval tdata)
2 l$ ~! w; x( T) {1 [2 Q   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
1 ^# |; B( i" G: f   MakeTable = tdata ' K7 Q; G4 I* f
End Function </P><>'***********************************************************
' \* i! U- [& c% W1 s4 D1 o0 q''@SDESCRIPTION: Draws the Debug-panel
: _8 H, v1 ?/ ~2 @'***********************************************************
& I( h% s4 ]$ ~5 B0 ]2 [Public Sub draw() 8 _1 R" I* q5 p4 Y* ]" G: p: I
   If dbg_Enabled Then
8 I& x8 b2 o9 L( ?) ?  u$ x! r     dbg_FinishTime = Now() 9 [2 W6 P  O/ \/ d* y7 R4 T
  - t5 b. T& T' U& O( _* G
   Dim DivSet, x 7 X- r) e1 Z" J0 |6 |
   DivSet = split(dbg_Show_default,",")
  |1 h* Z' _$ h1 f5 R     dbg_Show = split(dbg_Show,",")
+ d1 c: S3 a9 ?- ?7 U$ B7 R1 B+ C6 M  
5 O% [; X! B6 c) ?; M$ e   For x = 0 to ubound(dbg_Show) $ }, }9 n6 U" w- l% k( H
     divSet(x) = dbg_Show(x)
* j* G9 I3 K* z% ]  Y   Next 2 T3 |7 M* k" Y, {* Q
  
* {/ B. w- l; ]/ s   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;" . E$ J- E9 ?! e$ `2 H5 o
   Call PrintSummaryInfo(divSet(0)) 7 s3 x3 j+ n6 w1 B
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* ~7 Z% Z3 H" R    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 7 K6 w8 D1 r7 ~- K1 @; z2 a
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") & o- `2 q4 i0 V" N! a0 m
    Call PrintCookiesInfo(divSet(4)) # _2 N1 u4 H* k1 N* s
    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)) 7 |1 V6 `/ E+ z
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
4 a; {3 P; B" R* e7 G    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
7 j4 s! j% X" T$ B9 q  U) ]* L: }6 b    Call PrintDatabaseInfo(divSet(8))
4 a4 d: r6 L' z. P    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
) v% g. C0 K- X- x    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
) K& \+ {+ D* @! D1 J$ g2 v    Response.Write "&lt;/Table&gt;"
/ b# s( ~& C0 }  ?0 m; v* s   End If 2 z6 e9 e% O) e5 v4 \: G! q
End Sub </P><>'Destructor
! Z% L+ s: r4 ]* c) KPrivate Sub Class_Terminate()
8 d8 l+ S" i. w  x  Z   Set dbg_Data = Nothing " V3 A0 N, J* N- ?+ x2 ]; c7 `
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>2 S4 P/ ?  D" D1 h$ f0 v' Z0 t
CLASS debuggingConsole
  h, \: }! \! O2 ^8 J4 TVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
) r' K) ~. s( C2 a&amp;n4 J' N6 s8 _* M9 F2 b0 B( N
bsp; - Q2 ?5 ?1 E- ?+ o# u
Property Get Enabled===[bool] Gets the "enabled" value
( k; s$ a* v3 U2 B  ; I& o9 H0 w9 _: s8 w$ i
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
, ~. q, q8 F% I8 x( y* \6 U    v; S+ [! m, [5 Q) h+ y2 {* c# T
Property Get Show===[string] Gets the debugging panel.   W) Z) x. Z( y( Q: j/ k
  ! I' q- a! i/ Z% O, l
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><>--------------------------------------------------------------------------------
' g: |' o( w# GPublic Methods </P><>public sub===Print (label, output)
! i: Q: y% D9 l6 l9 a* h   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
8 e. Y# ?# T) G+ }. o( N. j   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
7 |- A3 o* D/ O   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- , d3 z+ [* d( f0 e0 m5 J/ b4 Z
Methods Detail , W; C8 ~8 a% J. X( ?9 }
  
- z" Q) G; \0 t& Cpublic sub===Print (label, output) ) l9 Y/ I: H: z) R4 @1 |* L+ h
Parameters:  
1 }+ u! v7 A0 y$ E& J% h* y( D   - label [string]: Description of the variable
, _) g, V$ ^" J( q+ l   - output [variable]: The variable itself
' y/ F0 t+ }  ~9 b+ [  _! ~  
7 n  s" ?* r- a+ o* r8 Tpublic sub===GrabDatabaseInfo (byval oSQLDB) 7 |  m$ W+ \; c# Y7 C( D. U$ |
Parameters:  
. S5 j2 y# d" D  N   - 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-5-31 00:18 , Processed in 0.319979 second(s), 57 queries .

回顶部