QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>& d' @! h. [" I8 P  M7 @
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! ; L  u5 I: \0 ~' q: H5 Q
使用方法很简单: 4 Z8 j0 T) D2 [! n6 X* W
test.asp </P>" q" i3 j3 r. g$ N
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 1 u1 B+ j  e3 H! u1 J+ z) L
&lt;% 7 Q8 K3 v6 ]7 T
output="XXXX"
$ k* S, k7 h' J. XSet debugstr = New debuggingConsole 1 P$ A1 W# l- K: [5 O( P6 I
debugstr.Enabled = true
2 K* g0 S' ~5 M( S0 U; u# t3 j4 X   debugstr.Print "参数output的值", output 6 l9 }+ f$ v. D
   '……
3 U3 C: ^8 R' P& ?4 V   debugstr.draw ( a6 X- f& z' r- y5 l& B( N
Set debugstr = Nothing 3 e9 x& X- L  F! g% ]2 h/ j
%&gt; </P>0 [7 |* s  H& L& o! e# ~: [
<>=================================================== </P>
$ T% ?* v& V& m' j3 @8 v/ I<>debuggingConsole.asp </P>4 S$ J$ @# r& L, U) Q
<>&lt;%   H+ ]$ N6 G5 x) B  w7 S& [. Z' ]
Class debuggingConsole </P>. Q: j% A8 W& ^: B; e7 \: t
<>   private dbg_Enabled 1 u( P- V& s* B4 K: C: H
   private dbg_Show $ v$ x# R1 e! A# {( ?1 V
   private dbg_RequestTime " P: }3 U6 p3 F. B3 j
   private dbg_FinishTime
/ f0 `2 q" t6 ~) _   private dbg_Data 9 g4 W, j0 u1 v0 e4 e. P
   private dbg_DB_Data
* \  r# ~% E3 t$ U   private dbg_AllVars
" q  A  p: a/ k; y4 ]0 e. L) A   private dbg_Show_default ) E0 P  j) C) P/ }
   private DivSets(2)
/ @3 Z$ v' t) U1 ?   
) O# o, E3 ~' m4 ?" t1 g% H8 i! V'Construktor =&gt; set the default values " `- p. [* E- ?0 U3 `
Private Sub Class_Initialize() ; a3 |0 w& C" c4 B( q$ j
   dbg_RequestTime = Now()
  J, E$ F/ A1 D2 a$ A5 h9 b% e   dbg_AllVars = false # t: b6 v7 e) Q/ P' @  v+ H# L5 {* Z
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>
8 g( _  T" U- ^0 {* i3 c<>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+ g$ }- E; ?, b3 o# u
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;6 V1 O( t$ u, @+ w% X0 p
&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>* s1 m6 i+ [9 d0 z6 v5 R
<>   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>
: ]7 b+ b. p' l<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
9 X5 B8 ], l6 A/ ?End Sub </P>
$ @' _6 [. E1 c* T3 B9 F1 ^<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
) G8 y8 k8 y% f/ z   dbg_Enabled = bNewValue + C0 r3 d8 l0 J! I  C; k
End Property </P>( H) q  |3 Z% q8 `6 V2 T
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
. X+ [+ Q. _5 m9 E3 o   Enabled = dbg_Enabled ' l& U# z, Q: \3 B- o' O
End Property </P>4 M3 I) D, T4 b- }2 g
<>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 0 L2 {, ]) ]! I  L$ c
   dbg_Show = bNewValue
- W+ S  Q5 H# x! F. E+ nEnd Property </P>6 X3 \* o: S0 p6 j3 U
<>ublic Property Get Show ''[string] Gets the debugging panel.
1 r$ t9 c4 U. x8 C. H& q/ D   Show = dbg_Show $ X7 S7 p% V7 I+ O" r% ^) D0 Y
End Property </P>, r" d* r: j" d' i: \
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false + Y: r2 }: {- t9 `. _$ a
   dbg_AllVars = bNewValue   w" c; i4 s) }% J0 l9 I
End Property </P>
9 e2 _2 [- T( F7 D4 @<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed. % i& E8 x( b  t
   AllVars = dbg_AllVars ( m3 m: w7 k: R/ O
End Property </P>
% J6 ^  o  U* w9 _<>'***********************************************************
6 b+ h$ R$ x! n' F. ~. U''@SDESCRIPTION: Adds a variable to the debug-informations. - \& }# X6 k* |+ w9 Z" N& ?. ]
''@PARAM:  - label [string]: Description of the variable 4 {9 X4 X" i, E2 W  r, m0 H( w
''@PARAM:  - output [variable]: The variable itself 4 c% m6 j, c0 J( d
'*********************************************************** 6 M3 y5 S: k3 I# y, q# x. A
Public Sub Print(label, output) 8 ~, I6 V8 N5 ~& ^, _" l
   If dbg_Enabled Then / |( V" `9 x+ H& w6 B5 T) M! C
     if err.number &gt; 0 then & x$ Q7 E; N1 |- U/ ?
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) ; J1 p. B$ J. l) M  t7 ?8 C
       err.Clear & d4 \2 X$ ]2 t+ r9 Z+ O$ q6 R
     else * D2 ]# H! I1 l* \& `2 b
       uniqueID = ValidLabel(label) 2 j9 Y, |4 N+ O6 \; e" E
       response.write uniqueID ) d: a9 t6 Y' {* Y( P
       call dbg_Data.Add(uniqueID, output)
  Z' F& _8 p0 B  V( T' z8 d     end if
4 ^1 l+ G2 p4 V& ]" I/ U/ g* A; O6 V   End If
' o8 f5 x$ s9 R+ Z; Q$ d  _# EEnd Sub
. f' K# D& H8 J0 N' W4 g5 ~7 a5 r  
. [8 X, y8 P/ H* b9 {" L'*********************************************************** 7 x! e) Z- X7 q
'* ValidLabel
. \& q0 G6 a' g$ Q: v: P* D'***********************************************************
# D' Y1 |" i1 `: M2 v6 pPrivate Function ValidLabel(byval label) 2 \* {. W4 H1 `. \& V  Z0 P. T
   dim i, lbl
- c6 O4 \+ i; R# s0 V& _   i = 0
; y9 w: X" g( a& q* n0 z   lbl = label ( X+ D: d* O9 K+ l
   do + B) }! x' w: \/ I) Y4 |
   if not dbg_Data.Exists(lbl) then exit do
/ h$ w* ?( e* Y8 R   i = i + 1 * {! H5 e8 L& {+ g1 g% M* w8 ~
   lbl = label &amp; "(" &amp; i &amp; ")" + O& o6 X5 W3 o. G; ~
   loop until i = i
% P/ @" B) j1 D) P9 L8 s* m4 G5 r8 _  
: Y4 ^+ y' t( {) O) X   ValidLabel = lbl
' }% k* ?% o" g- T: gEnd Function
8 i% E- L- O* I# m) x/ a  
/ g1 J1 q7 \$ b, X4 e7 q' h( y'***********************************************************
' b* U& l! M" e8 L4 d5 A1 u. ]$ C'* PrintCookiesInfo 9 \) X7 M, L4 k: @5 b
'***********************************************************
0 i: [3 z/ P: |$ g- |2 _! K3 QPrivate Sub PrintCookiesInfo(byval DivSetNo) 9 ^; b: i8 N. t3 B! g* t
   dim tbl, cookie, key, tmp
4 ^7 e8 \5 B& t+ t  O   For Each cookie in Request.Cookies * W! E8 O$ |' T8 C+ [# I# {" t
   If Not Request.Cookies(cookie).HasKeys Then
4 i6 i& T& u# O. i$ [! q     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
- i) g# K7 k' T2 g7 K   Else
: r) I7 H: Y3 z4 z+ U$ j     For Each key in Request.Cookies(cookie)
! l5 {7 g& l1 P, F     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. # c% V3 ?- W& G
Cookies(cookie)(key))   ; x7 b4 a0 r  L5 B* k+ h
   Next
% h& R; v8 A0 t   End If
8 y7 w" Z& j7 a   Next </P>
( c/ R4 a; {9 P( D+ M* s0 p  |<>   tbl = MakeTable(tbl)   Q, a' \( F: y( q6 m6 b+ g
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
0 R& X- Z9 U9 E   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) 4 u1 j- t% k" l; o' B+ T* Y) }1 t/ \
   Response.Write replace(tmp,"|", vbcrlf)   H" r1 x0 {% r6 b& m
end sub
+ z7 ^, q/ ^# `4 M/ B  
& Z: \4 V0 m) z$ U5 I# W9 i3 I'***********************************************************
' z" G3 w* a9 K# t'* PrintSummaryInfo ; j* R* ^: t7 L/ }. e" S% g
'*********************************************************** 1 h% K0 a# D9 s, j7 r
Private Sub PrintSummaryInfo(byval DivSetNo)
/ J( ]) a& Y  [; T! E7 b   dim tmp, tbl ' q0 o  q7 W5 c1 {6 m
   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) & E% h, k/ m! o
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds") 5 y6 ~! q6 c- u; |$ [' d
   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) + M! O3 |" G. z9 `4 r+ z& h
   tbl = AddRow(tbl, "Status Code",Response.Status)
3 Z+ ^  Z7 z5 h5 f, `+ p- {. i   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
+ b$ y& r- m' |1 f2 V4 \0 k: k   tbl = MakeTable(tbl)
% R6 k1 |2 v: W2 p5 J' X/ |   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 5 U2 E. D/ l$ n0 n8 h
   Response.Write replace(tmp,"|", vbcrlf) % o' n* M+ J: p% d9 Q, k
End Sub </P>
5 {$ \8 Q! e' R+ k5 ^& \<>'***********************************************************
( F/ B9 b( k1 g/ G& X''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
( q9 f: Y* S$ [" c* @9 e, w/ r''@PARAM:  - oSQLDB [object]: connection-object / O3 Q0 m8 v! ^. P, d* O  L; T2 X
'***********************************************************
4 E0 p) n' b; t/ g. jPublic Sub GrabDatabaseInfo(byval oSQLDB)
# ]- Q$ E7 c7 n( |8 I% P' W7 A9 g& c   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) 6 G! P$ U+ V% s- s
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 5 ]# _2 c! r4 D" h8 O5 V
   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 }5 P* n3 f8 }, h
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) & R. u# x' O/ x7 ]
End Sub <>'*********************************************************** 4 y9 \  n! [% I6 y, \
'* PrintDatabaseInfo
6 l3 O$ U4 h9 h2 [' A. f8 F$ m  S'*********************************************************** ) M/ W' T. w( e1 \  [* x
Private Sub PrintDatabaseInfo(byval DivSetNo)
. F, k. j" {6 _3 f! Q  m   dim tbl * \# W5 U: [; q; w4 B/ e, ]# c! @
   tbl = MakeTable(dbg_DB_Data) + }6 i/ y0 T3 m3 d
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 5 x9 H7 @. f8 m2 c
   Response.Write replace(tbl,"|", vbcrlf) : S" i' Y. L7 z) ^1 d- R
End Sub </P><>'*********************************************************** " P8 d$ s5 t& J( ~3 D. k0 w( ]
'* PrintCollection & S8 B4 z4 r0 h3 C2 S
'***********************************************************
" N3 T' ^1 s2 N. _Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) , V; y/ L9 I+ X3 v/ B/ C8 v1 q4 y1 m% L2 a
   Dim vItem, tbl, Temp % S) b+ p+ ~0 m% a) @
   For Each vItem In Collection 1 R, Q  {8 T$ m5 n; z, }! ~; z
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 3 I0 ^6 s% Y) A; K4 m8 r. _( I+ s5 a
       tbl = AddRow(tbl, vItem, "{object}") 6 z* l( f4 r0 V( i" j
     elseif isnull(Collection(vItem)) then 2 }  u$ {( p' o4 g6 b
       tbl = AddRow(tbl, vItem, "{null}") . d8 A; g9 p4 n- z6 w
     elseif isarray(Collection(vItem)) then / M2 g: K( g- ~) z7 u
       tbl = AddRow(tbl, vItem, "{array}") - m0 a" b( Y2 p/ \
     else 1 Q4 Z8 p; R$ U2 K' J$ W( a
       if dbg_AllVars then ; L# K' d( d+ j6 {6 w$ N, f  ?
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem))) : }! R% j2 X1 ?% S; j  _8 L% k
     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then % h! W8 x! _: M8 Z! c* S( u
       if Collection(vItem) &lt;&gt; "" then
3 N$ m4 _3 R% p$ r$ C  ~       tbl = AddRow(tbl, vItem, server.HTML7 f9 e* _3 _: H! W2 Z' l- E# G
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
' _1 i$ R! U2 Z8 K6 k9 L       else 9 F* m7 z: [! I" `# U
       tbl = AddRow(tbl, vItem, "...") / Y- F  c+ x6 m' K3 n* b
       end if
  S, Z$ e% u8 e) t  c     end if 6 b' B/ R0 n6 S) o4 d7 }5 L# `
   end if $ I, U" _4 Z- p- z4 a7 ^( W) T; y
   Next - a8 q9 @% f4 V1 R1 q& n
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo , e: s1 J6 v# `: {- p
   tbl = MakeTable(tbl) ; H% \. j& s# J' I
   if Collection.count &lt;= 0 then DivSetNo =2 & w5 k9 m1 h8 G; Q$ d4 T
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
  E! o1 l2 t- a( g, R     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
* r) V0 w+ B3 N7 ]' Y( o     Response.Write replace(tbl,"|", vbcrlf)
0 F2 f6 n$ l$ F0 l5 K, LEnd Sub 4 T: r$ u5 ]9 ~- Q
  
( a. ]2 q5 k: B'***********************************************************
- ~/ N  l# Y9 s, C) w3 @'* AddRow / t5 x3 J& Y9 U# c  ^# M
'*********************************************************** & n6 ]- C: d8 U. i; h, y
Private Function AddRow(byval t, byval var, byval val) 7 w4 I- B! U1 b1 J" p
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;" 3 y4 E/ K0 y% @  `+ Z
   AddRow = t " S0 w3 A4 B" d8 ~5 u# y
End Function </P><>'*********************************************************** % @, k7 _3 Q; D- j1 Y, {$ s( P2 ]! T3 j
'* MakeTable
. W9 w" B1 J5 L) I/ n" \3 F2 B% E3 e# I'***********************************************************
) q, y2 G- L$ a! RPrivate Function MakeTable(byval tdata) : E5 v9 m! \0 F
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
$ Y8 a: s, Y/ z. ~" l' F   MakeTable = tdata 1 M7 W* r- b5 X% F) s: k) H/ |' e* |
End Function </P><>'*********************************************************** . G! v3 N" t3 Q' v$ h' c/ W
''@SDESCRIPTION: Draws the Debug-panel 2 t7 e9 c) \! a- l' N$ Y  d
'*********************************************************** " W9 j& S$ N( V0 ^9 ^( C# B
Public Sub draw()
+ a. O/ P2 P; G3 f- d   If dbg_Enabled Then
9 r% @' N1 k* ^: y6 L/ K5 Y( u, B     dbg_FinishTime = Now() . j  S; ?% O' G: o' O. p
  
% T4 C5 L* @: D* ^   Dim DivSet, x - y2 q  r  r1 `- O" O
   DivSet = split(dbg_Show_default,",") + Q# ?7 @4 J& J6 b; k) X$ g
     dbg_Show = split(dbg_Show,",")   |) U* l  S( N& [. L
  6 P8 m' v" J2 q: t$ U9 c; L
   For x = 0 to ubound(dbg_Show) 0 s6 {1 x. d  n  K" C# C6 [& M! n# n
     divSet(x) = dbg_Show(x)
* y! X* j! }0 y9 P0 y' _* r9 e   Next
: }" ^+ L6 [( Z" x$ b1 A: z( k  
3 ?* y7 _& r- D9 \2 Y3 d; Z   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;"
$ f/ [* J4 [+ U# ~* J   Call PrintSummaryInfo(divSet(0)) ( u8 b5 E  {0 O* g' q4 q
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 7 u2 v1 E1 e6 r9 y
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
( O, t; @" T+ s8 y- f% N3 Q    Call PrintCollection("FORM", Request.Form(),divSet(3),"") : F4 Q3 a7 r: m4 O  r
    Call PrintCookiesInfo(divSet(4))
' ?6 P6 h* K  d9 t6 l    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))
& ?4 H  c% [9 P3 C8 _' W8 _    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") . ~% t1 m) b5 ^' c( u
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) + u) ?1 A5 G4 [: {$ }
    Call PrintDatabaseInfo(divSet(8))
7 _# d% \' R# o    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ' Q' q3 r$ _  u7 ~4 \1 x2 r1 ?) H; r. e
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 0 S1 w- A/ P; O  `' {. y
    Response.Write "&lt;/Table&gt;"
9 a( v, X) R. D2 s1 K, C   End If : s( ?! Y( U9 d  k- a: ^9 Q
End Sub </P><>'Destructor
9 L! [9 S5 `  g4 C, jPrivate Sub Class_Terminate()
7 G( K$ }+ R4 P, P- h9 |+ n; U5 z   Set dbg_Data = Nothing
' w% n  }5 E" PEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
+ O5 W" C& _3 _- PCLASS debuggingConsole : J- g( I7 c1 j6 u. c9 O
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
( o2 R( l: Y! J0 p4 K- J+ O&amp;n
3 O8 {5 a( r& x5 ^+ ~* z% d1 Hbsp;
  L& ^1 p8 ^8 N5 v5 }Property Get Enabled===[bool] Gets the "enabled" value $ V! ]# s' s- x9 G8 S( x
  
' s/ O: [! y+ NProperty 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
+ M( b2 G& Q' p1 k6 l  ' h2 r# D6 b" d# l1 s6 x
Property Get Show===[string] Gets the debugging panel. ' e- H/ Z! _, e% ?, ~8 A
  
7 P/ n9 i' W, N0 r" ?8 W) c2 |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><>-------------------------------------------------------------------------------- # p7 z7 ^8 c, {+ N+ \. r
Public Methods </P><>public sub===Print (label, output)   f! b) Q# L8 K! w# ~
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
9 L, Q: q5 O1 H: f8 X   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () 7 M  y1 ]; a+ ?9 P
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 4 I; N, {9 e" U. W& h4 A1 G
Methods Detail
; N3 X0 r/ o3 q- J  b! P  ! ]8 M9 A+ L7 n$ ~
public sub===Print (label, output)
- q0 F2 G3 D# g. J8 |% zParameters:  
6 J0 B) [/ y" t! P5 V   - label [string]: Description of the variable
) S* m. f9 w$ m* r   - output [variable]: The variable itself
. S! N0 W8 K9 L  {/ v  ! F' q1 i1 L7 ~
public sub===GrabDatabaseInfo (byval oSQLDB)
2 E' V$ L' c' D8 _Parameters:  
2 c2 [% f3 u  R; A9 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-1-3 15:06 , Processed in 0.466609 second(s), 56 queries .

回顶部