QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
- O+ C8 F5 s9 Q9 `2 V8 ]3 F<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝!
. g2 x6 y% j" U使用方法很简单: 1 n, Z/ d. A2 ]
test.asp </P>: ^% \9 N7 s1 r# _$ [- u4 N
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt;
2 d" u1 T: ?, @&lt;%
4 f6 }. k$ i! `3 g" u6 woutput="XXXX" * u* Z$ J: e- G
Set debugstr = New debuggingConsole
8 s& Z: n* G6 _6 odebugstr.Enabled = true * ]0 L  t. |2 Z$ {9 ~- G. z; S
   debugstr.Print "参数output的值", output + c# ~  X" N8 v; x" g
   '…… - S) ]9 j6 s9 w
   debugstr.draw
7 u8 V$ U" y. v  B1 }1 ?Set debugstr = Nothing
) _% d# b, N- u/ K5 Y. B7 W%&gt; </P>7 w! a& j* v$ Q: H4 h& K; z
<>=================================================== </P>- F: c. V; W$ D9 Q
<>debuggingConsole.asp </P>
2 h8 T# h  n* k. S& |  B( o! T' u1 O# n<>&lt;% 0 S1 \; H" d6 @
Class debuggingConsole </P>
; L# B7 u7 g: H) ~/ x* S, G<>   private dbg_Enabled
9 w/ K" O/ L$ a- j& |( G   private dbg_Show
! L; ~5 W! L$ k. m3 z$ j- d& ]   private dbg_RequestTime
( T1 o* T+ R% d/ q# H0 \" A   private dbg_FinishTime 8 P. `6 u  L( n* B% A
   private dbg_Data 1 g2 H7 w  B+ `) y) |  ]
   private dbg_DB_Data 7 |( @) Y. F/ |; O# I
   private dbg_AllVars % [! M, I/ n( {0 e
   private dbg_Show_default
3 N- y+ t9 V) m/ P   private DivSets(2)
+ B; P* c% U1 f% ?, {( k1 [   - y% ?+ E* d, e1 i3 |
'Construktor =&gt; set the default values
) [0 F2 h: m' h% dPrivate Sub Class_Initialize()
3 T7 k0 h# W2 F2 p: a! o3 K   dbg_RequestTime = Now() + G- }. }# W% f. z6 \
   dbg_AllVars = false 1 l$ n6 e* a& y/ Q% q) o6 @
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>9 L% Y- F& E  v, W- J9 o6 F
<>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>7 I9 `  Q, q5 ^1 L7 R. i
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
) d% e1 F2 Q- C+ e+ e* V&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># C" @' u$ f5 r/ s) u3 i" i( B# j
<>   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>
" z( i+ ]: I. s8 u$ z5 [5 q<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
  Y( Y6 k$ Z- f7 Q, H0 |End Sub </P>
6 t8 |8 W% e! |2 T<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false
6 C. r8 r# i. H; d0 r' S   dbg_Enabled = bNewValue & a4 a+ s, E) m: g& j' o
End Property </P>
2 M( @: U7 L: F  z# c! O<>ublic Property Get Enabled ''[bool] Gets the "enabled" value 2 j/ C, G9 u$ `2 R* z/ v, S0 a0 f
   Enabled = dbg_Enabled
/ }) Q8 ]  k8 ?" V' M/ f7 uEnd Property </P>8 S% M0 A4 w+ U$ 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
0 D$ ^; u5 P, \, z" L& d6 J3 m. U& |   dbg_Show = bNewValue
: b7 P1 I4 u  S! gEnd Property </P>- Y! w( u' X& u8 M! y7 t" f- o1 c
<>ublic Property Get Show ''[string] Gets the debugging panel.
5 t1 x+ `( F' W0 v& Y$ r   Show = dbg_Show ( ^, v+ }/ e6 m
End Property </P>3 [3 z) |5 U. [2 G- Z
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false 4 j) B- X- j8 A+ ]
   dbg_AllVars = bNewValue
* x8 l) R* ~! g1 M7 k9 gEnd Property </P>
3 ]& a" [7 n- v% A<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
% C5 |3 \; @3 I& g6 \, ?   AllVars = dbg_AllVars
( r8 I& Y* y$ v; T1 d, mEnd Property </P>7 `4 r3 W8 y: ]! k
<>'***********************************************************
4 k( I4 ?& K+ a+ z. Z1 ~$ C) I' B2 b''@SDESCRIPTION: Adds a variable to the debug-informations. ; Z" Z3 B- x. G0 X! j4 N" T
''@PARAM:  - label [string]: Description of the variable
4 l- r8 V4 X3 ]; {. V( {$ G5 D''@PARAM:  - output [variable]: The variable itself
+ u) O6 i( n) _'***********************************************************
0 Y$ c, b+ ?6 mPublic Sub Print(label, output)
; Y5 X! S, F: {+ z6 I   If dbg_Enabled Then
% x$ J+ |/ g: O# [9 K  d( N% r! C- m     if err.number &gt; 0 then 6 S3 `: l$ P* k: y5 a9 ?4 U
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) ! K; p6 i7 ~& f4 n0 {: K0 i+ u' X6 q
       err.Clear 8 e+ I7 I( j, w2 H
     else
# o6 `) k; ]1 {3 F" D3 ]+ [       uniqueID = ValidLabel(label)
+ L4 C# a* r$ U, M" ]) \6 ]# {0 C. N6 ~       response.write uniqueID
$ a; k: ^9 N4 P% h& ]  F  o       call dbg_Data.Add(uniqueID, output)
) ^7 }5 Z! L1 [     end if ; q9 P- ?8 ~' H% h  T
   End If
" t. b9 q% E. C' p* H7 t7 ~- B/ v1 r& zEnd Sub
/ l; N0 y' K. e; y  
- q$ G0 {+ P! R'*********************************************************** 2 ]! l% f$ X: S; [* e
'* ValidLabel
9 J3 L1 d2 d6 P  L: ~'*********************************************************** 2 v9 f) P4 ], a6 u+ ~
Private Function ValidLabel(byval label) + A7 {0 A( {+ x  g, S) I
   dim i, lbl 0 }9 ]6 n7 L4 ~! C7 y
   i = 0
1 Y0 p, U$ c2 V: x9 V   lbl = label
5 a4 N# M. B& t1 G0 ?4 q) M, Y   do
* o; o) V4 M! q/ Y8 g   if not dbg_Data.Exists(lbl) then exit do
1 N( v' Q; r8 Z8 P   i = i + 1 * l8 g# I0 X7 h5 ^; a3 x
   lbl = label &amp; "(" &amp; i &amp; ")"
7 E, j7 c' S  d   loop until i = i 5 U' q+ N1 D" U& ^& K
  
/ L, @) D, [8 ^   ValidLabel = lbl
0 b# I# ]8 W# U7 r  bEnd Function $ v& q3 X( n, q8 |" Z* g6 Y9 h+ G
  9 W) g# B: A5 ?
'***********************************************************
6 [, b) n9 J) m* ^% k'* PrintCookiesInfo 8 a' u) T, S! z
'***********************************************************
! {& m: }2 I( L8 P* CPrivate Sub PrintCookiesInfo(byval DivSetNo) 9 e& k+ h: z4 y& d' h% C! G7 e
   dim tbl, cookie, key, tmp
- ?# T+ c, C4 m  i7 {; T$ H, }   For Each cookie in Request.Cookies 6 w' z4 S: g; y' D) N
   If Not Request.Cookies(cookie).HasKeys Then
6 P' t) H/ G2 Y1 y- a6 `3 o     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   
/ r! K" a( }' [   Else 5 {5 s+ {8 a7 V; A7 E" a
     For Each key in Request.Cookies(cookie)
# t2 d4 {% |* c6 @3 Q     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. 5 Q& e0 i' |2 [/ ^
Cookies(cookie)(key))   5 M) O3 A- u0 @( a9 A$ C, _
   Next " G) n2 K3 U, j# ^
   End If 8 u! J+ r) i$ a: ]7 d, S, ^
   Next </P>: d# ~7 ^+ Y9 E. H
<>   tbl = MakeTable(tbl) 5 L, M$ I7 g4 f/ n7 l% I" z
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
+ o+ A" E, s5 g% R, {& [. p: r/ }   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
& e2 e9 c6 Y: g. L7 W% w5 J( U8 y   Response.Write replace(tmp,"|", vbcrlf)
) ]' z; X- a- p1 a; D& `end sub / L3 O4 o" ?# c: R5 s
  
" q4 ?( j$ a& l) z'*********************************************************** ( j* ?  {8 M* ]; n/ A& j
'* PrintSummaryInfo
: \, h8 \: A) V$ N& b, y/ x'***********************************************************
& h" p, L1 R/ j/ \3 o9 G6 U7 B; lPrivate Sub PrintSummaryInfo(byval DivSetNo)
! |; L4 w9 ~& f( v" U6 s  ~   dim tmp, tbl
  @# o. k6 X0 k/ N9 A, `   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime) 6 W0 p3 T# @; M' @! h
   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
( u6 i  ^" o# F* f   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD")) / D- H& B8 H6 s; y
   tbl = AddRow(tbl, "Status Code",Response.Status)
: t, @9 h0 z* G& h8 F( u   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
9 h  C" v: a/ T+ q8 i! D5 G0 e   tbl = MakeTable(tbl)
$ Z/ U  ?$ K: m% V   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) ( T, K" h- ]2 I4 V) t$ G
   Response.Write replace(tmp,"|", vbcrlf)
! t8 `) D# ]# w4 ]. E* z0 WEnd Sub </P>
1 ~5 K3 N" X. P0 i<>'*********************************************************** * s  u! s$ k3 u; r
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information 5 z5 \: y  h- J5 B1 N  @
''@PARAM:  - oSQLDB [object]: connection-object
: F; W  y% ^6 o# S'*********************************************************** ) ~9 p, L2 b7 M. V# j
Public Sub GrabDatabaseInfo(byval oSQLDB)
/ f9 B7 H: c9 t) ]' K  ?   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
6 V( Q0 l% c3 k' ~   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ! r0 J' ^/ U5 {% o7 b8 P: |
   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# V! m9 k3 ]   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) ; x: u# R- w1 [2 f0 \
End Sub <>'*********************************************************** ' N# F) O! z7 ?! D' i) Q4 d
'* PrintDatabaseInfo 2 A* U; A% Y: J5 t+ x; v# V
'***********************************************************
$ F7 V& k* D* Z5 dPrivate Sub PrintDatabaseInfo(byval DivSetNo)
% W; C6 P, x$ `$ ?   dim tbl
  R' C! q) K9 j3 Q: h* O. [   tbl = MakeTable(dbg_DB_Data)
, I8 C. a$ G; f, w   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) : C3 |0 t7 p0 F; j) z
   Response.Write replace(tbl,"|", vbcrlf) / Y* D" [$ {4 C" `8 k
End Sub </P><>'*********************************************************** 4 N. m7 b/ q2 [& a; A
'* PrintCollection
7 u5 F+ \6 ?& R7 R4 ['***********************************************************
$ E2 j, X  I( x4 F) s* p: Z. ]/ APrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)   z+ e* ^% E6 k# Y: y- q
   Dim vItem, tbl, Temp
3 J1 G4 @  j+ t. g# `# e   For Each vItem In Collection * z, D' L  Z! q6 o
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then ; E+ [* }0 e3 s. _! Y8 K0 f9 p
       tbl = AddRow(tbl, vItem, "{object}")
% l$ _  h  B2 U8 b* S: e     elseif isnull(Collection(vItem)) then ) w3 R& u7 H  q  C( s
       tbl = AddRow(tbl, vItem, "{null}") " t9 R8 k" w. X( I
     elseif isarray(Collection(vItem)) then ; }' c0 {0 q7 W" x. U6 \; i9 _  P( o
       tbl = AddRow(tbl, vItem, "{array}")
$ c8 x# K: a& f8 d1 x     else 9 y7 F! L& A$ [- K" M
       if dbg_AllVars then & B7 ~8 _) b2 s# ^
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
3 K, q: M9 K4 g* Y0 H! G! Y. a  i     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then ) _7 n8 P6 e3 {, w$ Y2 q6 W
       if Collection(vItem) &lt;&gt; "" then
6 x+ z" d. k- g+ W3 `/ ]* q5 h       tbl = AddRow(tbl, vItem, server.HTML* t, u: V: g5 q! x0 F# q3 O6 A
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
: f5 U/ x) g: K       else 8 S1 G/ Y, u8 A3 i  n" Q
       tbl = AddRow(tbl, vItem, "...")
- V; g+ d" v" ~+ {% T       end if 0 U( m; D* {9 ?& C: F
     end if
/ C# U' j! S/ Z. V+ k. f- m; v   end if # r6 K; q9 A" V& {3 y# }5 i
   Next 2 A' F1 U4 n+ `+ Q& |' f+ [
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo , w  s) g: M* W  E' A0 ?) S/ V  {
   tbl = MakeTable(tbl) 8 _! i! |7 J) _3 X/ W. }. f) Y
   if Collection.count &lt;= 0 then DivSetNo =2
8 d* [5 x  B4 e/ g+ g     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) / C9 }; v& M( e; D0 h/ p9 F
     tbl = replace(tbl,"#sectname#",replace(Name," ","")) 3 Q1 f, b- S5 B5 N
     Response.Write replace(tbl,"|", vbcrlf) + ], {7 Q! [9 E4 O+ k1 l$ S& V! M
End Sub
. h4 L* ^! a  d0 j# S+ j0 d) m  8 [7 e7 ~3 T: z# u# B, V5 h" K( ^
'*********************************************************** . D) u# r4 b; Q, X9 O7 f
'* AddRow . {* C' s% `  m1 X
'***********************************************************
. i( E  c4 V! l- v1 x0 cPrivate Function AddRow(byval t, byval var, byval val) , I; k# |5 ^$ p
   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
( L. I  e. i) ]# W% k  D   AddRow = t : Q3 Y( v9 o+ p4 {  {
End Function </P><>'***********************************************************
. Z1 [4 ~# s; a: t) M' E'* MakeTable
: U  l& f/ _( Y* R4 k2 R'***********************************************************
# R# K5 d( L7 W" n: x) TPrivate Function MakeTable(byval tdata) 9 \7 v" A7 p2 {: U7 B! M/ P" N
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" / `. `& f4 r- F1 x9 S& M
   MakeTable = tdata
% W% M0 `9 }" w- c" ^& J5 B" x8 s4 MEnd Function </P><>'***********************************************************
6 k2 b: {) d* Q" T# ~+ v: r''@SDESCRIPTION: Draws the Debug-panel
( t! L) m/ B1 f+ q9 z/ y9 Y1 E1 q'***********************************************************
3 R0 _  T' z2 S9 a) EPublic Sub draw()
1 f, i9 w2 O) z8 a$ Q7 v+ j6 B/ F) E   If dbg_Enabled Then 2 i3 h  x" P) T7 L  }( J5 J; e
     dbg_FinishTime = Now()
. |1 i. X$ b8 R3 r' E* n  
( m. Z; \/ K+ i: C   Dim DivSet, x
1 s9 t; r, e, h9 E4 Q1 s, T2 e   DivSet = split(dbg_Show_default,",") & `9 L  C9 J, _; P7 v8 a" L
     dbg_Show = split(dbg_Show,",")
* b- G0 r( i7 m# Z) C  s  4 n# a( Z/ V' [/ k  t( z3 w, _& V
   For x = 0 to ubound(dbg_Show)
: H% ^1 R$ S' b6 s4 v     divSet(x) = dbg_Show(x) $ h: k: p4 ^9 k
   Next
5 P+ m1 }6 H4 e( @2 s5 q  9 z0 L: w! F3 T% {- \/ 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;" ) \- f. Q0 J8 I8 ~6 D- u
   Call PrintSummaryInfo(divSet(0)) 5 B6 o+ S) ~/ m& j
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 2 Z/ C1 I! c" r
    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")   y. _; o$ l7 D" `. P- v: l
    Call PrintCollection("FORM", Request.Form(),divSet(3),"")
- }5 j$ r7 h6 Y' a    Call PrintCookiesInfo(divSet(4)) $ L. X& N$ x& O9 N/ `' @
    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))
9 O9 N5 W- s8 z+ k' \6 S    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 3 N/ _$ z: G8 |2 y6 `0 p5 t5 F0 X
    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) . |! z" V" v+ \: n3 X
    Call PrintDatabaseInfo(divSet(8))
4 V, t" y2 F1 e& E5 Q% U- o7 {    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
7 d9 F1 b2 K4 e0 a  V/ I    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 8 ^1 W4 c( X# }  }  C( v
    Response.Write "&lt;/Table&gt;"
4 y* M8 e" v2 }1 Y9 O   End If - r) d8 e; \* N
End Sub </P><>'Destructor
9 ]; ]4 E9 U4 ?. x) E+ HPrivate Sub Class_Terminate() 9 {" c, z  E/ v/ }
   Set dbg_Data = Nothing
( e" D8 Z+ z! f) T6 W3 }$ G5 bEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
( r7 P: z& o" e, n+ yCLASS debuggingConsole 8 F2 [: j% P* X& Q5 y6 K
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 N( t! f3 m  v&amp;n3 E" N6 B. n6 E. U7 K
bsp; 7 A) o! W; d) z
Property Get Enabled===[bool] Gets the "enabled" value " b# {4 P" Z. T/ M
  / U7 g# Z9 C9 [/ A
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
9 C  S# X- R5 h; ~  / z2 J6 z' P( w% z6 E% \
Property Get Show===[string] Gets the debugging panel.
3 J. Z7 A' k" M, f5 q  & |% r2 ?5 O' _- [1 B: e" ~' r3 b
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><>-------------------------------------------------------------------------------- + ^5 c% D: |: v
Public Methods </P><>public sub===Print (label, output) , S+ M2 D- T1 B3 h
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 0 `' N( u- N  x' c1 g: h) ]
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () , j9 m( M( \$ A! I
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- + ]3 k! f3 l2 _' r8 s4 @( ], q
Methods Detail / E! ~* [6 y  K( g. z! X5 t
  
- z! ?3 w* y5 z/ m: z, P( ypublic sub===Print (label, output)
/ @6 X: j0 n- \$ {1 G" d. ?4 _7 @Parameters:  
8 W( z0 ~1 v, A! @3 C2 a" o! g   - label [string]: Description of the variable
/ r8 [  e, L' U5 a8 w   - output [variable]: The variable itself - f! e3 E3 D5 H# o, J
  " U/ ]0 ]  b3 H! X" f7 u, @
public sub===GrabDatabaseInfo (byval oSQLDB)
: I6 e4 ^5 |) }7 Q5 C- B# VParameters:  " i; D# H& t" u* q+ X
   - 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-12-15 02:57 , Processed in 0.645914 second(s), 56 queries .

回顶部