QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>. r9 O4 A; G$ m3 \2 D
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ( V. ]% k+ a# j: j1 a1 v1 ?
使用方法很简单:
# ^& Q. g6 F$ ktest.asp </P>+ h3 F1 Y. s! ^2 _. H
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
" M5 m' T) t/ |) ?&lt;%
  I( B/ H2 W* V: K& _& Q& ?output="XXXX"
+ D7 y( G; N+ A3 X$ g  pSet debugstr = New debuggingConsole
' i% ]& |5 ~2 w: `! t8 odebugstr.Enabled = true & M( L/ P0 }: z- u, q1 [( [
   debugstr.Print "参数output的值", output & ]  R% n! \: g/ z# v
   '……
' {6 }9 U$ j6 M% Z   debugstr.draw
3 w' }# ?0 [5 r  ^8 p: SSet debugstr = Nothing
9 i& W1 S" D- a) n  i%&gt; </P>
. ?* l& e# t. Z1 P<>=================================================== </P>4 `/ w9 t5 \* k% }, K- C
<>debuggingConsole.asp </P>
" j1 I, ~9 D/ q& D<>&lt;%
3 S1 f# ]9 ~8 f) h9 EClass debuggingConsole </P>
  Y) \7 v- A4 }- }# |9 Z5 ]<>   private dbg_Enabled
# _7 @1 g8 `) g; h5 g4 ~   private dbg_Show
! y6 h: P+ e; b( X   private dbg_RequestTime
4 z$ s& u6 V% u   private dbg_FinishTime
3 g' p0 f8 d: p$ K7 D   private dbg_Data 0 P& O0 B: z  n- m' e  t% l
   private dbg_DB_Data + `3 n& {4 H% k
   private dbg_AllVars % c: K8 P+ C. Q, B! @8 p
   private dbg_Show_default . b0 r" [" z! f, H) [
   private DivSets(2) & W# D4 E" V9 U. B7 o/ X4 d; d' u
   & O3 y# w, x+ i. N, M; V
'Construktor =&gt; set the default values 2 R4 J* z. ~. N
Private Sub Class_Initialize() 2 i: v1 w: o) P$ O
   dbg_RequestTime = Now()
9 c, @+ O) K9 r8 b7 q$ A- Y   dbg_AllVars = false
/ F5 }4 n, v# ?   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
: b% ~% G4 n$ r- u6 P6 K. a9 I8 h<>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>- j0 n5 l1 `6 d; g) i/ C
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;- z: U# P0 {5 J( O" p" Q, T- r
&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>
6 q) O+ w% c# K<>   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>6 z1 t0 X  c+ u2 O6 K- f; P1 m! x
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
5 v3 s! u8 `$ |4 `! c- JEnd Sub </P>
8 L- {9 w7 i  x" X  H<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false ( S9 }0 q7 b# O- `
   dbg_Enabled = bNewValue
: W( g/ f% x- ~9 G5 u6 u- T8 R' zEnd Property </P>5 C' V8 W  G# r$ i  l, |
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 2 {) ]3 v3 G; ^2 H. |# J
   Enabled = dbg_Enabled
2 _+ p9 l/ t5 a4 ?- a5 k7 H4 BEnd Property </P>" I  n. K$ |- S+ J$ _
<>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
8 ]8 B; R9 k" o5 E8 S   dbg_Show = bNewValue
! P  N% ^' z1 n! j. X0 Q' Q" G! k* O& QEnd Property </P>
% g8 z. c  z0 H4 S- `<>ublic Property Get Show ''[string] Gets the debugging panel. ! Z$ C/ a4 u9 @) H1 g$ h
   Show = dbg_Show ! `3 x; s6 u/ D/ w; X2 p
End Property </P>
$ j# X6 Z2 A8 z3 L<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
# X& f7 @: n7 W6 l   dbg_AllVars = bNewValue
5 r& [1 C3 t2 {+ ?9 a" l% B) J  c: O+ _End Property </P>" M! K' |* t9 [2 Z: Y$ I
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
7 A  l2 t% K5 D" ^3 y  |! o! [- @, _   AllVars = dbg_AllVars & a* O4 B) U$ d$ S- Y# N8 D
End Property </P>
  P( |1 ~6 F6 w8 }  ~<>'*********************************************************** % u. d2 U& d' G/ s" \
''@SDESCRIPTION: Adds a variable to the debug-informations. ( u& @7 V* O/ w% @7 e# S
''@PARAM:  - label [string]: Description of the variable ! N  I8 K& S1 H& u5 S& q3 `+ e
''@PARAM:  - output [variable]: The variable itself
4 K& ^& S$ c0 I- N: z) L6 B'*********************************************************** : Q2 ~. t9 i7 ~' `9 Q) B* j
Public Sub Print(label, output) " `4 Z" i) V* S
   If dbg_Enabled Then
4 E/ W$ J. R+ D. U7 y+ g; _     if err.number &gt; 0 then ) }0 S- ]" |/ K
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) + L* B( N! K1 I* X* `5 E4 q4 ]
       err.Clear 0 ]: b, x6 Y1 G# B; W' F/ N
     else
5 z3 K  Q8 L4 }9 I' M+ b       uniqueID = ValidLabel(label) 4 l' c5 I* r/ f- g2 [
       response.write uniqueID
9 J  K9 C- x) Z) N/ X" v* g       call dbg_Data.Add(uniqueID, output) . N. g7 V# D4 L( `" z! |& O% R
     end if ; Z' X$ ^6 U8 `* W# }( @
   End If
5 v! S  A$ ^% L. {" a5 x7 S* xEnd Sub , w- i% Q2 _7 F& j7 G* n3 S  v
  
1 k. U3 r- t: ^  ^) w" ['*********************************************************** " R% r8 X; x  X4 m+ o# }3 I! C
'* ValidLabel
2 Q' \7 X; R3 y8 V- W( \( F'***********************************************************
. ^# j8 N; D1 H  D1 V% F/ k% dPrivate Function ValidLabel(byval label) 5 d# }7 J( r. h7 H8 p( E3 R, _
   dim i, lbl 3 @  y$ C8 W" L1 o, J- u9 H, f
   i = 0 4 _0 `3 @  g/ i+ {# u% u8 z2 R+ a
   lbl = label $ p( q6 r1 O* t1 Y  T4 ?
   do - @# c# m% @4 M2 {. r% X" W
   if not dbg_Data.Exists(lbl) then exit do 1 W8 g3 g& }6 c1 R! K
   i = i + 1
' E. T7 W. [( t: U, T) |7 _   lbl = label &amp; "(" &amp; i &amp; ")"
: L  R/ Z! M  w1 J   loop until i = i - n8 d/ K# x) s, C4 Z( c
  
+ |9 d/ t9 C! P! L" E   ValidLabel = lbl
- x! H  I! d3 C8 P; u' @2 BEnd Function . N4 i" y- O% L
  9 l6 g" m! \. @" V) _! W* g
'***********************************************************
% C! g1 d; P* n/ E0 M0 z1 Y: Y  \'* PrintCookiesInfo
: T7 l/ \" j6 ^& }7 A- s'***********************************************************
- j$ W  E9 y0 E* [& w' q4 k  iPrivate Sub PrintCookiesInfo(byval DivSetNo)
. T. o1 y) J: @$ k' Q   dim tbl, cookie, key, tmp
& S$ n3 l6 z/ H8 Q  r- |   For Each cookie in Request.Cookies
- _1 O0 M( k( [7 L   If Not Request.Cookies(cookie).HasKeys Then
6 F* G0 W# \& ^6 h0 j' Z     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   " V8 B# A8 x- n) s) T) K. y; r
   Else
+ e6 A; ~# J# j- T/ v. h8 G; Z% Q     For Each key in Request.Cookies(cookie) : _- B0 e, M  S) X9 b! P( A
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
5 ]5 n1 r& b8 L* ?6 bCookies(cookie)(key))   % v. J/ C& A( h" h4 d
   Next " @8 T1 A' R- ?# z7 p% {5 g0 f
   End If
; h* n! o+ t; ^# g   Next </P>
7 f5 J9 o5 y6 z" y/ ~( }<>   tbl = MakeTable(tbl) ; i& O( F/ g% B) R. F
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2 & Z. \/ f8 ~7 r/ Z  ]3 U7 [
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
& E& x1 m4 v+ C5 D" G# M: ^   Response.Write replace(tmp,"|", vbcrlf)
1 {0 ?* `2 @5 t5 q' A& n* ^end sub   ~7 D. E$ a7 S7 k. A
  8 Q1 Z" Q* }  y
'***********************************************************
1 x0 u- Q" B, D: M! \/ `: m'* PrintSummaryInfo
' m# x7 a! ]0 ^# G+ T: H'***********************************************************
* K5 [6 Z0 M- X2 Y+ n0 P3 GPrivate Sub PrintSummaryInfo(byval DivSetNo) ( C- ~* u/ [# t' p! J
   dim tmp, tbl 0 E9 g0 B; _5 t8 N  e+ _
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)   I- H( }- w6 P7 U  K
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
8 g! I1 H! e& x2 }& z3 T   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
+ d' Z" n+ k: ?- u& J6 @   tbl = AddRow(tbl, "Status Code",Response.Status) % W: y1 P, I4 ^4 A3 u
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
9 x# |) C! `7 O1 C. W- C! b   tbl = MakeTable(tbl) & z% x8 A  T; I$ Q  P. [4 W  m7 T9 A! R
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) " D( p2 e2 D; x6 r9 g
   Response.Write replace(tmp,"|", vbcrlf)
8 B& B7 ^% B" \2 l% z' X2 k" D5 a* }End Sub </P>2 l5 M, o5 K/ M
<>'***********************************************************
5 q' r  o! {0 D! n5 D" F( N! p''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 7 E6 j6 O, @! e$ W6 C
''@PARAM:  - oSQLDB [object]: connection-object # E+ r# g8 {6 ~/ j" P; L8 q- ]" o
'***********************************************************
5 h" w3 X( j3 Y. d* @  ]1 vPublic Sub GrabDatabaseInfo(byval oSQLDB)
; p& x. g# o3 R- F# x  ?   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
: |# P( W) L( d" t2 f6 a) f   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 0 r8 `' m' p3 ^/ p% Y$ |
   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"))
% p. x, O  M5 Y8 f$ A% l* B   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) 4 F7 H* Z. u) J2 x
End Sub <>'***********************************************************
! g5 l/ t3 C6 y0 u* |: K$ J2 V  b'* PrintDatabaseInfo
5 ]$ S; a3 g. r+ C% u/ U'***********************************************************
+ Q$ E7 x2 Q  _! d2 lPrivate Sub PrintDatabaseInfo(byval DivSetNo)
, U& O+ s0 m3 l  w   dim tbl
' S6 ]1 q) {! C+ S; B   tbl = MakeTable(dbg_DB_Data) / G8 O% z8 k0 p
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
/ q- r: o. T5 r9 G& }) E   Response.Write replace(tbl,"|", vbcrlf)
2 v. @6 m6 j" l4 Z6 `End Sub </P><>'*********************************************************** 7 x9 t& k6 e+ @# D; @$ `# E
'* PrintCollection
: C. c* D' S1 F; {7 Y9 t'*********************************************************** ' b# ~/ B& ?, @- ?, ?9 v  A
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
- F$ X. I( G) l( {# H- _! ?4 c   Dim vItem, tbl, Temp
" n, K( Z7 O9 b3 R   For Each vItem In Collection
6 p. P$ a, {  B2 V) @     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
3 i  ^# ~5 r7 F9 e$ {       tbl = AddRow(tbl, vItem, "{object}")
$ O: |' ]: {! ?( i     elseif isnull(Collection(vItem)) then 2 {; I0 i- H  w. K
       tbl = AddRow(tbl, vItem, "{null}") . b! l% ~  e) {
     elseif isarray(Collection(vItem)) then ; k$ l# \3 ], @$ ?7 C
       tbl = AddRow(tbl, vItem, "{array}")
5 _) q" B$ z! w( V+ q" u     else
( r2 O4 E( J( y% ^3 E, R9 I5 R       if dbg_AllVars then
1 J3 p% D8 S$ m7 q$ D3 w. n       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
: z* i- v  H: y% ^     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then . D& T4 k/ H5 l0 k: V; H2 f
       if Collection(vItem) &lt;&gt; "" then " k  n/ u4 l0 e$ V" j% T
       tbl = AddRow(tbl, vItem, server.HTML" r$ _! b, w1 t8 K' Z% U8 M% v6 w
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}") 0 ^7 P) L( [" ~
       else
% i% t% A1 ^: B0 l       tbl = AddRow(tbl, vItem, "...")   Y2 C, P' N( s( \- d& ^
       end if + P# h- n6 c7 y/ g8 o+ @2 @7 W$ n, \
     end if
! x! J1 l4 i" Y$ _$ R* d   end if ! G- Q- R3 @1 B: x. p
   Next
" ]1 D1 S8 L$ {: x2 ?( \7 S# n' G% ^' ?   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
7 c$ ^: F' W: k3 S7 J0 e   tbl = MakeTable(tbl) ; \: O$ @: p# q$ E& o9 X
   if Collection.count &lt;= 0 then DivSetNo =2 " D. e! e% @5 {5 ~% Q& p& M6 s
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)   T" o1 T4 m/ Q5 u$ l% J0 C
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
  W& j  {& C  Y     Response.Write replace(tbl,"|", vbcrlf) ; s9 P/ }9 K% N9 \
End Sub 6 r, x2 S0 U! p5 q! X! l
  
# q" s5 ?, i/ S# q- `'*********************************************************** 2 l6 m3 k2 c7 L, N; l  l( U
'* AddRow   r* R& C; W0 O4 ?: b
'*********************************************************** ' q/ M' y; m/ ?, ]6 D# n' d# J& X3 l
Private Function AddRow(byval t, byval var, byval val) : L2 L6 v: s( ^1 Z% E
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
, |. I3 k+ B# ~( _   AddRow = t   e: M1 D  r: `1 t8 P4 z
End Function </P><>'***********************************************************
/ p0 q: r3 n- N'* MakeTable
1 Y% ^6 l7 S" o'***********************************************************
- P% C: r1 X6 U. TPrivate Function MakeTable(byval tdata) 1 Q. a0 q4 d' x$ g
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
5 X/ Q( Y  m) E  k$ `6 G$ Z6 `5 u  x   MakeTable = tdata $ J0 B4 A( H+ C+ P+ W5 c
End Function </P><>'***********************************************************
# e  x3 c! _2 }''@SDESCRIPTION: Draws the Debug-panel
+ w5 [9 M1 l# w5 K'***********************************************************
+ K- W/ d4 v: A5 J& W; vPublic Sub draw()
- S, f. ?7 c9 `! Z9 l+ O( X   If dbg_Enabled Then 4 V0 O. v8 Y7 J3 I& c$ R5 C
     dbg_FinishTime = Now()
5 X9 r. e: O% g4 u2 R# ^2 c1 N  W  
- n+ J9 ~/ W3 K8 P8 K   Dim DivSet, x
" s: K7 e1 @- c   DivSet = split(dbg_Show_default,",")
2 p" V$ B, L; @5 `8 D( l( p     dbg_Show = split(dbg_Show,",")
5 F9 P9 A- a1 _9 M: Z  
( j0 k9 U3 I' J3 m1 I& Z+ k6 Y' _& Q   For x = 0 to ubound(dbg_Show) ' D/ i+ U) f4 }: d) o2 i) M
     divSet(x) = dbg_Show(x)
/ J6 y8 [3 o/ }/ |( \   Next
1 n5 X2 f' y7 }8 o0 \8 p$ B) i  * T$ h$ e: F- e* p3 m) {
   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;"
$ L* z1 X' O: z  p! B# y, O0 h   Call PrintSummaryInfo(divSet(0))
+ F' O3 j( g& N     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 7 }5 S$ a( G) B) @5 p. R! W
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
, m# i' J* |5 m# P; w& u) g( l    Call PrintCollection("FORM", Request.Form(),divSet(3),"") $ x/ E) f' y) e, f+ t) o5 y/ R6 G, F* E
    Call PrintCookiesInfo(divSet(4))
9 a4 y8 Y( \: F+ ~8 u$ ~    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)) # G3 I, f* Q2 d# }( M5 q8 \+ z
    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
* C) ^, X0 P$ Y    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
2 m' u3 `' S2 a& O( \$ D( l+ a    Call PrintDatabaseInfo(divSet(8))
4 G) C$ B6 L" R5 v2 V6 k; Q# d    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") . }3 g4 s! ^# F- W7 l
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
) V: j- S- f& _# A) E* C! i    Response.Write "&lt;/Table&gt;"
& d# P6 Q5 n. ^& N: `: Z- m* g# H   End If
! l, C  L% N( z# l2 TEnd Sub </P><>'Destructor ; S; a7 \- }" c: }+ a' C
Private Sub Class_Terminate()
& Y+ C1 j6 ~% |8 @) _   Set dbg_Data = Nothing
- J. m  W5 \1 `/ L) Q0 }$ |8 ZEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>0 _) h8 C) L, N0 `$ c
CLASS debuggingConsole 3 M  ?" w! K, j; [7 _1 H0 r
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false ) _" N3 S7 T& }2 o& K/ Y
&amp;n9 Y, f* R# P& ?" I$ L; ^! I4 ^
bsp;
0 j# j5 C. s. h5 H2 E+ Y  bProperty Get Enabled===[bool] Gets the "enabled" value ) g- ]. @3 h' R. T
  
. D% D& Y4 m- x) J/ Z. O* RProperty 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 + Z  v& S) S% L, T% o0 [+ j
  8 g( O8 d9 o$ O: M7 c8 W) \  ], n  r
Property Get Show===[string] Gets the debugging panel. $ M9 t- ^# j8 _
  % N2 ]# `" X# }
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><>--------------------------------------------------------------------------------
8 G5 A  C  P5 O4 D0 c# M% MPublic Methods </P><>public sub===Print (label, output) ' w- l% Y5 o# t) i+ O
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) " }( D2 V0 S' P5 l
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
* i) i$ |/ G. H1 C   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 4 l; v7 ^, x1 l! z: _5 w4 r* T
Methods Detail . ~" {0 N; A8 H! o, X0 i- B
  
7 Z8 ^5 k/ J1 Z8 d$ J4 xpublic sub===Print (label, output) 5 j/ W9 O3 c9 A
Parameters:  
9 i7 H! ~/ l: _! {2 f. c, j- u+ u1 J   - label [string]: Description of the variable
% f+ o9 K5 r7 e% r' {% B1 f# g   - output [variable]: The variable itself : C4 s% R+ o; w. R5 p4 t- `
  
9 x# m+ [$ ~+ `public sub===GrabDatabaseInfo (byval oSQLDB) 3 h# f2 p/ Y5 ?9 X' {6 ]1 w
Parameters:  
% O- a2 }$ k; ]( F1 o# w  l   - 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-9-19 15:13 , Processed in 0.692970 second(s), 57 queries .

回顶部