QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>$ R% V0 j& O$ M7 D( m
<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! * m( {. T- H& Q1 h1 s2 W
使用方法很简单: 5 ?  X$ D7 I" l  v
test.asp </P>
- U+ J- }3 {+ t<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; 1 K& }0 b  M) N  b  M
&lt;%
& ?0 Q; R. M, f6 L# Houtput="XXXX" 5 b$ D- d6 D. A) C3 U
Set debugstr = New debuggingConsole
! @6 J! q2 @$ {2 qdebugstr.Enabled = true
" V% G5 e% F) S* F3 @, d# [" Q   debugstr.Print "参数output的值", output ; a; K/ ?5 I$ \# ~
   '…… & m% p& j5 K8 O5 I6 Z" B
   debugstr.draw * B* {( \+ a/ n  j" q
Set debugstr = Nothing 7 \( X4 e. N! n4 t4 @% o+ k
%&gt; </P>. O. p# B; A5 x: P( @  M
<>=================================================== </P>
7 P5 i5 Y3 W/ G4 s. l2 r% \8 }<>debuggingConsole.asp </P>6 s$ R3 U# G4 c0 o3 M( D- m: L
<>&lt;%
: o" e. w7 d7 Z( u8 D4 F4 rClass debuggingConsole </P>
% W3 \( B0 R. Y0 l7 w8 C1 D  o<>   private dbg_Enabled
+ {1 c, V! u5 Y. P6 g   private dbg_Show ) a0 o, q- M  I& h6 _
   private dbg_RequestTime " r# P9 c- X2 s8 M' n3 n
   private dbg_FinishTime
( }* X5 E2 q" o7 [5 [   private dbg_Data
/ @5 m- I# X( D% i) C   private dbg_DB_Data
& }, Z3 }/ p9 D7 {: G   private dbg_AllVars
% T( ~* S5 y3 g! t: V$ u   private dbg_Show_default # A, c0 D$ u; q3 r7 _
   private DivSets(2)
- }5 t3 u& `9 g   
) m5 X- u! ^: e/ O& x- h'Construktor =&gt; set the default values
9 d; L2 ?; O9 W6 K8 ZPrivate Sub Class_Initialize() % q/ @* y: x0 F% ~
   dbg_RequestTime = Now() / ^. \/ B; m( O4 S5 j
   dbg_AllVars = false 1 f+ H4 ?- T1 S9 L' A+ v
   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>5 H4 O% A6 P: C; i; ?
<>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 ^" R( m" ^5 _" x7 Q3 y
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;
* [% M" u8 H2 R% M  n&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 J" c* F  A6 j. G+ T
<>   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>: Q9 |/ I* y# D$ [3 _/ f
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0" * z& O+ d( ]& s/ ~$ T; D
End Sub </P>
4 p/ @& ?7 D: Y5 z5 H6 O8 F8 [<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false ) b4 o- M- B/ t7 u1 i
   dbg_Enabled = bNewValue
" |1 n' _* Y- fEnd Property </P>
% ^6 l4 \; l0 M7 b0 z. {6 q<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
9 a9 K- ~3 {# y   Enabled = dbg_Enabled
. ]' d% N- I" T  k- O; _) CEnd Property </P>( ^0 V4 _4 s' a% 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 * k; u) O5 z/ x5 F: ]2 W! K
   dbg_Show = bNewValue
1 P. f4 Q+ `0 F  b3 mEnd Property </P>
+ G' p7 a2 s/ K8 N* x( j* D9 T<>ublic Property Get Show ''[string] Gets the debugging panel. # a# z- y7 w# ^1 M5 g8 N4 o( {% j
   Show = dbg_Show 2 E1 [/ A/ E, a
End Property </P># c, F8 L+ V! M( j( S" z' ]% K
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false
% m4 b+ o& d2 m% S( v+ ?   dbg_AllVars = bNewValue $ \$ M& P6 Y* n, p2 R
End Property </P>, q* k, Q% \$ M5 H* ?! ~% |
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
4 m% V# X% B! U' z! x+ X   AllVars = dbg_AllVars
) W. g* P3 f" NEnd Property </P>& K$ e& F4 s0 `$ l+ {( V1 `
<>'*********************************************************** 5 Y* h' \7 W* v! R% C
''@SDESCRIPTION: Adds a variable to the debug-informations. 4 f* }' g$ [1 s
''@PARAM:  - label [string]: Description of the variable 7 a' r7 i2 h) E$ R
''@PARAM:  - output [variable]: The variable itself
3 H% j, A# X! }4 ]- V5 i, p'***********************************************************
8 I/ _1 |" D4 I/ hPublic Sub Print(label, output) 6 ~% |7 P  R# C7 v2 F4 O$ z& N
   If dbg_Enabled Then . f6 w$ U, ^% M/ p' I: t
     if err.number &gt; 0 then   U+ f0 R1 C: Q- P: P, ~
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description)
, H" W2 ]  q; d2 @       err.Clear 2 D" }  a' C  U
     else % c5 E/ D& f) W/ n6 J
       uniqueID = ValidLabel(label)
+ |$ H* z& K" p5 x: u# Q       response.write uniqueID 9 ~9 i( h( L( @- C- T7 F5 l4 a
       call dbg_Data.Add(uniqueID, output)
" g& j: P: s. q+ E& O% ^     end if 1 ?2 a' ]9 P8 ?( g3 b
   End If
# H8 V2 L1 s6 w: O- qEnd Sub
- S2 [6 ~5 D" l( d6 S5 v  - A# ~# m8 Z( v' {! Q# R
'***********************************************************
* r/ {8 ^, O; T* M4 `  Z- Y'* ValidLabel
- }0 x3 b- l2 g: ]. C; Q) A'***********************************************************
1 M  C5 j! b, ePrivate Function ValidLabel(byval label) , M0 M6 b1 [1 D  r- {
   dim i, lbl 8 c7 [! G. W7 e/ W, u1 \
   i = 0 + i$ X. D) j: ?; d
   lbl = label
9 P" L# h$ ?  g; U   do
- g! T1 |2 ?: n/ `" P' a' m   if not dbg_Data.Exists(lbl) then exit do
' e1 o3 c( R+ J# m0 a, v1 s# [/ u   i = i + 1
- l1 j7 i' b5 |0 g   lbl = label &amp; "(" &amp; i &amp; ")" ! ^* ~+ U% r7 p$ g' K* u( m
   loop until i = i
6 Z: s# t5 O- u% `! i  ~. s4 M( `  
1 T8 p0 ^' j4 t; n7 e0 D. G( l   ValidLabel = lbl , T; B3 f$ k4 E, d# X
End Function
' U4 D& m$ b3 M* |, B9 x  , b+ R6 j( t& o
'***********************************************************
0 A( x4 o7 h8 D/ s4 U'* PrintCookiesInfo
. E2 Z) U* F; s$ W'*********************************************************** 5 W  C# a7 H# i
Private Sub PrintCookiesInfo(byval DivSetNo) 2 L& w3 s: b. A! V! d
   dim tbl, cookie, key, tmp 0 c* Z6 N2 C% N( [3 j5 V/ h. g, |
   For Each cookie in Request.Cookies
6 B5 e9 I0 W4 K4 D, K   If Not Request.Cookies(cookie).HasKeys Then
$ J8 l4 X& v1 p  `8 @! w3 l     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   9 H" H2 Z6 R4 t% i( S6 [2 s
   Else ( O$ ^' p% z( l$ q! J" ~- T, o! k
     For Each key in Request.Cookies(cookie)   @( l8 @# M1 t* z9 {' a- ^* u6 H; N
     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request. ( t( x- {4 P' ^2 v
Cookies(cookie)(key))   , b- Z  q" ^3 @
   Next   y7 L- X* y0 A0 P" [8 n9 K  d
   End If 8 T; W  y/ B+ F% u: V
   Next </P>8 `* f4 r- q3 `8 S
<>   tbl = MakeTable(tbl) 0 @# m) I& }. x# X3 z6 T
   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
, j  V$ L8 j4 ^& l   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl)
5 N( g$ w; J& z9 m6 `: Q   Response.Write replace(tmp,"|", vbcrlf) - r: _8 z0 y* N: i9 e* E* Y
end sub " x3 O% c9 J2 a- l9 q0 O; K
  
1 X  A8 Q/ y: N" b! f# F4 d4 _" B'*********************************************************** * L- _" G3 p$ C/ Z- i/ D
'* PrintSummaryInfo
& \$ z2 q* H6 k8 c'***********************************************************
7 n5 R" X, P& h; n% xPrivate Sub PrintSummaryInfo(byval DivSetNo)
8 q' @& l. x* t' w   dim tmp, tbl
' \. L; O5 M2 a$ s0 ~0 e! K   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
; e- G- r+ N; w) G$ p( Z9 D   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
4 B% B0 P' F$ h. `; N  u! A8 V   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
1 M* m7 J8 `/ t; m/ F0 j: I3 Y6 t   tbl = AddRow(tbl, "Status Code",Response.Status)
' ^0 I/ M& G2 }/ r" l   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
; G' i5 o$ B6 U9 `; t   tbl = MakeTable(tbl)
3 @1 D. X: ]* R. T   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl) 6 t7 K" B( |( z  b$ a
   Response.Write replace(tmp,"|", vbcrlf) 1 \& _, W9 ~% e  q5 E
End Sub </P>: X  M; }9 i% ^' p! @% X# Y0 `7 T4 j
<>'*********************************************************** 8 R: h& j* a5 r8 K+ p
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
, Z. J+ z& N1 T8 b$ S5 H0 G, B''@PARAM:  - oSQLDB [object]: connection-object
" }' E! M2 F% x'***********************************************************   A. t( U! Z3 v) L" w
Public Sub GrabDatabaseInfo(byval oSQLDB) % Z/ }4 h! s# I$ U7 k# v+ Z
   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version)
: \9 B5 v7 g! I0 B8 H   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) ) `. @, G& ^( F5 F
   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"))
2 p) U9 c9 w/ p$ ~% P1 r   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version")) + T& C1 {# S" t. I) ~+ f
End Sub <>'*********************************************************** - a! w- I2 B9 h# ?
'* PrintDatabaseInfo
+ I- R( C! M9 E, y% Q4 y1 Z5 ^' m'***********************************************************
' ~* f! l) M% R$ ^! ~4 Q) U9 r0 m* dPrivate Sub PrintDatabaseInfo(byval DivSetNo)
; ^) D, o) Q# G9 C   dim tbl $ A( ~& k9 V. [4 S+ s. T/ _# `
   tbl = MakeTable(dbg_DB_Data) 4 Y' r. b8 ^9 f( N
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 8 y4 P  _  I3 R, v
   Response.Write replace(tbl,"|", vbcrlf) 1 F1 q0 q5 d4 Y6 J* H- U
End Sub </P><>'*********************************************************** ' U) J9 O; i( [3 F/ g0 L
'* PrintCollection 0 Z) |9 V6 L/ r2 D
'*********************************************************** " S0 W+ f& W! w3 |; ^# G! }; D- E
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ' H  U' T" e! F3 j
   Dim vItem, tbl, Temp ! G8 G+ s& [. _9 ?$ @7 _( Z: i# N
   For Each vItem In Collection
! P- S- f1 Z* c# V* h: w& B     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then
: ~% Q. g! r* Y  ?       tbl = AddRow(tbl, vItem, "{object}")
. ^* t7 Z& N. k: }/ x     elseif isnull(Collection(vItem)) then
' P! K1 @  @0 _       tbl = AddRow(tbl, vItem, "{null}")
( H3 A0 i/ ^8 r7 @- b$ c( b& m     elseif isarray(Collection(vItem)) then
) O$ C2 K  ?2 ^3 H$ B5 \. ]* z       tbl = AddRow(tbl, vItem, "{array}")
" z/ K0 T: u) a7 _0 C( E/ M! t3 K     else
. D/ S* }& g; k. d5 w       if dbg_AllVars then 4 D8 ~# g1 F, H7 v
       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
, [: l# b3 Q) K9 V( q, C6 V6 q     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
% g0 ~6 I' H. d8 J: Q       if Collection(vItem) &lt;&gt; "" then ! N2 j$ E( j6 G" N& f& `0 s0 c; d
       tbl = AddRow(tbl, vItem, server.HTML; i% x9 p% O- ~
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
* U2 [6 }9 T. M- J6 S$ y       else
# N; f1 _; i$ `; N# [% Z       tbl = AddRow(tbl, vItem, "...")
+ ]3 n7 V) v- e0 X3 c- i5 ^       end if ( h0 L# G) k0 ~
     end if " x, E* a2 r  @) @. ~
   end if
: h: U" i4 N" m3 c7 }. S6 J$ ^( |   Next
& Y- ?- Y+ v1 A0 [$ O0 G" i8 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
- P% L- T+ d; D: S" T   tbl = MakeTable(tbl)
% j; S3 O$ t& X) c# T1 z   if Collection.count &lt;= 0 then DivSetNo =2
5 n2 |3 [' z% O0 L+ q     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) / g4 N" A# z6 R3 \) f
     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
" h. `5 m3 g; B9 \0 n' C! _/ K; ^7 C     Response.Write replace(tbl,"|", vbcrlf) ' @. e$ x! w; v- j
End Sub
3 j  b; O% `0 ]8 |$ ]& ?1 A+ a2 u: r  
6 B1 w; Q, i8 q( M; _! b'*********************************************************** 3 ^  w. @2 L& ?4 v2 {/ ~! ]
'* AddRow
/ m2 w9 M" A# n& I, [7 a+ k4 H# {'***********************************************************
/ Q6 M# k3 ^/ V% K) W4 jPrivate Function AddRow(byval t, byval var, byval val)
- v* t8 x8 e0 t$ h) s   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
# x) h# e- \6 m% N7 v0 S% Z  T   AddRow = t
3 ?) a/ q5 W8 PEnd Function </P><>'*********************************************************** ' o3 i. K8 N  f' k% R: Q* W
'* MakeTable
& Q2 S8 l& D$ J* w- L& x9 n) `'***********************************************************
. }0 c) r$ _5 z) c, m+ z$ B+ ^1 XPrivate Function MakeTable(byval tdata) 3 `. J7 ^& F- H8 u+ O3 \9 g+ D2 ^9 Y
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|"
7 B. b3 L* c7 c+ a2 c; C1 f   MakeTable = tdata
- X: X0 q% F7 {* ^4 m; V, EEnd Function </P><>'*********************************************************** * a( k+ X* e4 l* u2 |5 e+ J; P. d" e
''@SDESCRIPTION: Draws the Debug-panel / |' t9 y$ S0 z" O, }
'***********************************************************
4 A8 ]; e9 ~8 N; ePublic Sub draw()
2 x, C2 P6 u2 @   If dbg_Enabled Then 2 s+ c7 ^5 K3 I; V
     dbg_FinishTime = Now()
  [- y! U3 a1 \: G7 ~8 k8 r* h  % @+ v0 n0 Q" f7 q$ r
   Dim DivSet, x $ c/ T( n3 a  C2 L2 w* J6 c+ h
   DivSet = split(dbg_Show_default,",")
6 c: f& S9 U# Q5 g1 R     dbg_Show = split(dbg_Show,",")
7 d$ Z/ Q* F# s" J& p& Y  b0 j  
5 A) i5 d$ D) m9 V* u' @0 B   For x = 0 to ubound(dbg_Show)
. W' E- y9 e4 P' ~0 U9 @     divSet(x) = dbg_Show(x) 4 b, c" W: I$ N5 C% z
   Next
2 m0 e% D2 [+ L1 m/ ?5 G! c  
/ z" V8 m- z1 X2 Q6 `" L; l; p   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;" ' _, p" e/ U- b. ]' w- k6 @
   Call PrintSummaryInfo(divSet(0)) ( r8 I1 O8 P. s% j- x
     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
6 r' }1 O* K8 n# S) O7 y5 J    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 8 D; q& m1 Y  u/ \3 q
    Call PrintCollection("FORM", Request.Form(),divSet(3),"") ) N+ u1 I$ @" K- U6 U& C- ^0 z
    Call PrintCookiesInfo(divSet(4)) & n. Z, u& F8 c: N9 b7 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))
: \$ Q" c$ g8 y. J( \+ ]# `7 T    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
" W) z! ?9 v( t2 a9 Z) y    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
% P6 b2 [( t6 Y6 e# w. _7 h    Call PrintDatabaseInfo(divSet(8))
+ _7 ~- G* e1 ^    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 1 b( i5 C+ m( r! R7 x$ Q' C
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") / x/ w, B6 [2 {' b
    Response.Write "&lt;/Table&gt;" . Q& Z; |; }' K4 s4 g; i
   End If
1 A4 C: b: c3 G. M3 ]3 TEnd Sub </P><>'Destructor + o  q; S- R0 d0 T+ y
Private Sub Class_Terminate()
4 {5 X. K" C4 E4 o6 r' a   Set dbg_Data = Nothing
# n3 S2 j: h9 L5 cEnd Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>
0 F7 _% q+ K6 i) K, ^# PCLASS debuggingConsole
6 C2 U5 h" _( x! e" e0 m1 H0 xVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
/ H$ I$ R- U# M&amp;n/ I( Q' S% k. i$ {4 u. b
bsp; " `3 d8 s" F: T3 y4 D6 G
Property Get Enabled===[bool] Gets the "enabled" value
0 j( U) k1 M# S2 j, t  S+ W  
' }4 a6 U$ m- y' QProperty 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 / {% K% ]; R& r: z, f* e- I
  
& L  M- B( a+ N- c' B0 j/ h+ g0 fProperty Get Show===[string] Gets the debugging panel.
& F+ d4 N0 Y3 L  
1 m% P5 i$ `/ D2 f& Q; ~; GProperty 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><>-------------------------------------------------------------------------------- 4 e& s, p9 `4 K8 J, q
Public Methods </P><>public sub===Print (label, output) . x& N! j' r' G$ `" W
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
7 n" M) f  R: d) K& A" g   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw ()
$ y( p9 d3 v6 g" ~/ f   Draws the Debug-panel  </P><>--------------------------------------------------------------------------------
3 I. z% _5 @- Q& tMethods Detail ( u% D# D) ~, T: J
  
/ Q# b" g4 h4 _/ w0 |public sub===Print (label, output) " ]% l/ H8 ~8 o  P3 X/ {! L; U
Parameters:  
. Z+ ^( X$ t% \8 `   - label [string]: Description of the variable ; Y! d* }0 {! }) q5 B
   - output [variable]: The variable itself 5 s# W9 a4 d: c$ H
  + o9 ^* G) O9 P) t! x, l2 j
public sub===GrabDatabaseInfo (byval oSQLDB) 6 n9 W1 h, {4 i% O( A# V. y  {
Parameters:  
$ Z5 Y  t1 y! ]7 d  U   - 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-18 07:27 , Processed in 0.466247 second(s), 56 queries .

回顶部