QQ登录

只需要一步,快速开始

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

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

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

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-11-21 11:43 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<>不知道用ASP写代码的朋友是不是和我有一样的感受,ASP中最头疼的就是调试程序的时候不方便,我想可能很多朋友都会用这样的方法“response.write ”,然后输出相关的语句来看看是否正确。前几天写了一个千行的页面,里面大概有七八个SUB/FUNCTION,调试的时候用了有三十几个response.write ,天,调试完后把这三十个一个个删除,累! </P>
4 |" F4 j/ r8 T<>今天看到一个ASP中的Debug类(VBS),试用了一下,绝! 8 X8 D  T: N/ M" h
使用方法很简单:
8 }3 `; T$ O2 ^5 b- K4 l, x' [test.asp </P>+ ^: s# `, O7 ]6 B
<>&lt;!--#INCLUDE FILE="debuggingConsole.asp"--&gt; % B3 H4 T& }- V( L' c/ e
&lt;%   m" g* I4 G( [0 G& m" u7 ^
output="XXXX" - z4 G& B( j, T+ x5 B
Set debugstr = New debuggingConsole + a% b4 s! v& U, T& w4 A; M
debugstr.Enabled = true 5 Y/ q' d" Z2 t4 Q
   debugstr.Print "参数output的值", output . x2 w" T' \+ O$ ?, }4 r
   '…… " M5 V- G, }$ x$ S$ s% h+ L: k- }
   debugstr.draw
$ U8 U$ T+ I. [3 y; d! LSet debugstr = Nothing # Y. x6 Z8 p8 @' y, d
%&gt; </P>) a2 P" h) U- L  T3 m
<>=================================================== </P>- r3 {, b6 T6 {& t+ T8 l
<>debuggingConsole.asp </P>( y+ ?2 R, }. J1 G9 ~2 l/ H; d" m
<>&lt;%
, J! C! l1 P& B) S$ S- Y: e4 h5 iClass debuggingConsole </P>
* A  x# o3 _& w9 V5 X/ ]& Y<>   private dbg_Enabled 9 K' \% o( n0 e7 z
   private dbg_Show
4 X# V" j, \+ g# j/ X; B$ R/ U+ r1 _   private dbg_RequestTime
1 d( a* ?0 ?- F3 X& z   private dbg_FinishTime * e6 T. s- p: V. \4 Z: v; D% ~; v
   private dbg_Data # U4 F) {- k2 \' h! X
   private dbg_DB_Data
* ^4 u. e% W# I$ N- b+ b3 A   private dbg_AllVars % h/ R3 _9 }/ `# j9 v
   private dbg_Show_default 2 Q2 w5 w1 E( G4 p! {4 d6 e
   private DivSets(2) ! h( m) m5 b' N* t5 [
   4 m2 P$ b! V9 Z$ _) h6 M& ^7 z
'Construktor =&gt; set the default values 1 a) o6 f; S/ F7 R& b& S
Private Sub Class_Initialize()
/ I  g! Q9 P; J, i   dbg_RequestTime = Now() $ [$ P# X  X% N6 B2 r) m
   dbg_AllVars = false
/ f; Y/ `0 t! s- x5 |" M   Set dbg_Data = Server.CreateObject("Scripting.Dictionary") </P>+ G8 ?& ~2 B. I- ~  w3 Z' K
<>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 N) D9 ?& Q' e0 h  D" D
<>   DivSets(1) = "&lt;TR&gt;&lt;TD&gt;0 G# F  L& k/ O5 u% p' k' 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>
$ G- w4 L: Q; p# Y: 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>% w2 x" b! I  Z' X9 y7 m2 I
<>   dbg_Show_default = "0,0,0,0,0,0,0,0,0,0,0"
; Z& W) ?* h& X: ^# eEnd Sub </P>* y9 U) s& J) b& w, L: i
<>ublic Property Let Enabled(bNewValue) ''[bool] Sets "enabled" to true or false ! G% k7 c  y' S
   dbg_Enabled = bNewValue " z: ^' _! m! O% X7 `5 ^9 p; k
End Property </P>) Z) ^- n% o9 }3 K
<>ublic Property Get Enabled ''[bool] Gets the "enabled" value
" N5 y2 R: j, X) }" T5 P$ N   Enabled = dbg_Enabled 3 B0 E  i& V% N4 U6 k( b4 }9 o  y
End Property </P>% z% k  r& P! `, B4 T  G: m
<>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 ?5 y2 @$ j; G; n
   dbg_Show = bNewValue * J9 a& W' L+ U9 `; i
End Property </P>+ l2 e8 C2 W$ ^' t' S
<>ublic Property Get Show ''[string] Gets the debugging panel.
0 `3 e) ?5 o' Q: z& h' {" ^1 C% W   Show = dbg_Show ! f! @+ h6 c1 r
End Property </P>* H- D! ~" V; P; z$ h5 ?) n
<>ublic Property Let AllVars(bNewValue) ''[bool] Sets wheather all variables will be displayed or not. true/false # H4 U5 ?( n5 J1 J+ |% T8 N7 z7 K5 w
   dbg_AllVars = bNewValue $ l. m8 h9 c# I8 `  {; P7 `+ Y! k
End Property </P>6 J1 C/ ^1 g6 {4 m  z% h
<>ublic Property Get AllVars ''[bool] Gets if all variables will be displayed.
: z5 ^* m) h8 }5 F: u  S   AllVars = dbg_AllVars
+ u0 l: L* a2 l, pEnd Property </P>8 E3 p' e- m) J; M' m2 ^
<>'*********************************************************** , x- A, J0 D% r: x5 G
''@SDESCRIPTION: Adds a variable to the debug-informations. * x, p0 O5 E% Z4 s9 y6 K5 {0 O$ Y
''@PARAM:  - label [string]: Description of the variable - k7 d0 A5 A9 w0 J3 v3 j1 G
''@PARAM:  - output [variable]: The variable itself & u- Y" L, G; G! h% c( T+ h* Q( F# @
'***********************************************************
& W1 z( x( ?1 @" o" CPublic Sub Print(label, output) 7 g: f0 A  L- e4 R. u8 R& P
   If dbg_Enabled Then 8 H/ Z; d( H- v" S( m. W
     if err.number &gt; 0 then 2 N+ U) U. U+ {5 @
       call dbg_Data.Add(ValidLabel(label), "!!! Error: " &amp; err.number &amp; " " &amp; err.Description) 6 N5 e/ ~' z- f4 {9 H' J4 c
       err.Clear
2 B, N0 z2 C) P  u     else
4 c, [2 P" Q1 n2 v. U+ h       uniqueID = ValidLabel(label)
" i- m3 m* `7 u: Y+ ]       response.write uniqueID
5 N$ f. d0 B" O' F1 M       call dbg_Data.Add(uniqueID, output) 4 B$ @; z6 ?2 K  V4 _
     end if - [; z* }8 J7 g6 f9 T, }, A. G1 U# n
   End If
7 P; m* g+ L( K! r4 M6 g* z4 aEnd Sub
& ~5 N2 B* w. P3 @  
. h2 J6 C2 Q! U'***********************************************************
7 b3 w- q% G! l2 a4 g) t! a8 A'* ValidLabel : d' ~5 W4 F6 f' _
'*********************************************************** 5 {0 o1 a3 `* Z  O
Private Function ValidLabel(byval label)
) x' `- H( K& v   dim i, lbl
  U+ o2 P& ^. h   i = 0
- y7 q6 j0 z4 o2 }* q   lbl = label
  x2 T9 v; w9 X* x+ x$ h   do : F/ ^' w% A  M9 N  a
   if not dbg_Data.Exists(lbl) then exit do 0 S  T& a0 ]2 B) t" V
   i = i + 1
* b  ^2 G" r% l/ V0 Y) a, k   lbl = label &amp; "(" &amp; i &amp; ")"
3 y* Z/ g0 }8 w9 z   loop until i = i
* x0 N6 ?6 M  E. k4 o5 B, ]+ l  1 ~- l! J$ S& _; b/ h$ Y2 I2 x
   ValidLabel = lbl
, X5 }3 E' v9 B- j: p3 L% iEnd Function & Z4 r0 T- Q' F
  
+ T! z/ l: P1 v7 u'*********************************************************** # ^/ E3 ]" }% f6 c* w0 E5 f' \
'* PrintCookiesInfo 7 m! x5 }: |; s( e7 o
'***********************************************************
- ?1 y( ]  Y1 }+ KPrivate Sub PrintCookiesInfo(byval DivSetNo)
% Z8 N- z# k; r- m1 D; j) Y& x/ O+ {8 ]) ]   dim tbl, cookie, key, tmp
4 G$ B5 c6 J8 I5 A" M# e5 M   For Each cookie in Request.Cookies
/ Q8 K3 b. g. p   If Not Request.Cookies(cookie).HasKeys Then ' h4 @3 l3 U9 h9 N  ?# Z
     tbl = AddRow(tbl, cookie, Request.Cookies(cookie))   ) b: e1 l! G8 B' m% S) Z1 ?9 _
   Else % X7 }% ^5 [* E
     For Each key in Request.Cookies(cookie)
, r/ U6 C1 S/ L7 l( d7 B     tbl = AddRow(tbl, cookie &amp; "(" &amp; key &amp; ")", Request.
' @+ q1 c* L1 k$ p6 }Cookies(cookie)(key))   
! }$ ]: W$ v- F3 L" F* c5 f, Y. P1 G   Next
' T. L2 Y8 L3 I' e" b0 \! ?0 m   End If
' I- L! w% z2 u$ F; l6 Y9 b% l   Next </P>' t# n9 t( M6 H- V# W7 O
<>   tbl = MakeTable(tbl)
+ w/ |* o7 d. v3 f   if Request.Cookies.count &lt;= 0 then DivSetNo = 2
2 [0 \" c( X0 |   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","COOKIES"),"#title#","COOKIES"),"#data#",tbl) * x; X& s8 u  V5 \
   Response.Write replace(tmp,"|", vbcrlf) " z( D; w- w, ?1 R: {
end sub " V; o7 J$ ^5 U, g1 `
  
4 |  Y, U+ f  j! u& Y4 t3 |'***********************************************************
7 V) B1 t) g- i5 q9 r  G'* PrintSummaryInfo . Q" n1 J! `0 s% u3 I3 ^2 o  [0 C
'*********************************************************** 0 r: M& ~: E: E5 n7 ~
Private Sub PrintSummaryInfo(byval DivSetNo)
$ s* i3 b8 y0 h5 B) g$ Z   dim tmp, tbl
/ u& u( M+ ]8 o  I8 w   tbl = AddRow(tbl, "Time of Request",dbg_RequestTime)
% ^4 l8 e2 d) s8 ?7 {7 G   tbl = AddRow(tbl, "Elapsed Time",DateDiff("s", dbg_RequestTime, dbg_FinishTime) &amp; " seconds")
8 ^/ m. B# W+ |  e/ B/ H   tbl = AddRow(tbl, "Request Type",Request.ServerVariables("REQUEST_METHOD"))
1 S, }0 r# s# ~- c0 B! q2 ?9 k   tbl = AddRow(tbl, "Status Code",Response.Status) # |! `. @7 B! ~7 @3 P, W# c
   tbl = AddRow(tbl, "Script Engine",ScriptEngine &amp; " " &amp; ScriptEngineMajorVersion &amp; "." &amp; ScriptEngineMinorVersion &amp; "." &amp; ScriptEngineBuildVersion)
8 }  F* n1 T, ]+ E   tbl = MakeTable(tbl) % F  q( d1 x) h( ^+ p
   tmp = replace(replace(replace(DivSets(DivSetNo),"#sectname#","SUMMARY"),"#title#","SUMMARY INFO"),"#data#",tbl)
" p' ^( n" y! T0 E+ L1 U0 R) o4 i8 C   Response.Write replace(tmp,"|", vbcrlf) . U! i: T5 v+ @7 a8 c9 a2 F
End Sub </P>6 q9 Q4 P9 o8 z$ Q' `" [
<>'*********************************************************** 7 m" m% h8 s" ]9 W, z, a  g% K
''@SDESCRIPTION: Adds the Database-connection object to the debug-instance. To display Database-information
0 I& O* W" c8 P( ~% y2 l8 z4 a9 r''@PARAM:  - oSQLDB [object]: connection-object
, f* ?  t/ ?5 S1 m, s'*********************************************************** . Y  y" l, E: d) I" A
Public Sub GrabDatabaseInfo(byval oSQLDB)
# `, O) K& F; p   dbg_DB_Data = AddRow(dbg_DB_Data, "ADO Ver",oSQLDB.Version) + w) F+ `. y% F
   dbg_DB_Data = AddRow(dbg_DB_Data, "OLEDB Ver",oSQLDB.Properties("OLE DB Version")) 1 o- W& B, h; O" |5 k
   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")) / H0 U7 q5 V* F5 R3 U4 a& M
   dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") &amp; " Ver: " &amp; oSQLDB.Properties("rovider Version"))
0 T( f* z# f5 c; dEnd Sub <>'***********************************************************
: K0 x8 F; |. b'* PrintDatabaseInfo 5 y. Z  a- ~6 |" {( V( P
'*********************************************************** 7 d3 ^3 }8 C. u3 S
Private Sub PrintDatabaseInfo(byval DivSetNo)
; S. r' m0 W! B& j   dim tbl
# I% x1 _; {5 h7 T   tbl = MakeTable(dbg_DB_Data) ) H/ Y, K: `0 w, n
   tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
0 N  T& @9 \9 D2 W& M% ?7 z& O   Response.Write replace(tbl,"|", vbcrlf)
1 a/ \8 N" ^# d! s+ m' j  Q8 rEnd Sub </P><>'***********************************************************
4 V, d' D0 h% L. M; a. k- Y3 }4 |'* PrintCollection * }  e/ ]; e/ y7 c7 d: O6 Q/ I
'***********************************************************
8 j3 H' q1 }* }, yPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
2 V# C2 ?' j0 O3 X   Dim vItem, tbl, Temp
; w2 _) D3 Y+ x( v, U   For Each vItem In Collection 3 r( F  `/ V) J
     if isobject(Collection(vItem)) and Name &lt;&gt; "SERVER VARIABLES" and Name &lt;&gt; "QUERYSTRING" and Name &lt;&gt; "FORM" then 7 i; m$ `6 ^; ~. N8 K. S
       tbl = AddRow(tbl, vItem, "{object}")
+ Q$ z4 {! S: r8 r! }     elseif isnull(Collection(vItem)) then 8 L9 E+ v( L  F/ ~( c! D8 [# c
       tbl = AddRow(tbl, vItem, "{null}")
0 R4 K2 t+ ~- e. \0 U2 ?% D4 Z" J) w0 U     elseif isarray(Collection(vItem)) then
3 f- K' O, x6 o% w4 h: }# z       tbl = AddRow(tbl, vItem, "{array}") 6 J: v1 e, N- O6 \  H
     else
, c7 E+ \# H0 X. \# D0 M, _  N( B7 a       if dbg_AllVars then
4 J0 w/ r4 B; s7 X       tbl = AddRow(tbl, "&lt;nobr&gt;" &amp; vItem &amp; "&lt;/nobr&gt;", server.HTMLEncode(Collection(vItem)))
% i  f* R- c9 d( C     elseif (Name = "SERVER VARIABLES" and vItem &lt;&gt; "ALL_HTTP" and vItem &lt;&gt; "ALL_RAW") or Name &lt;&gt; "SERVER VARIABLES" then
3 ^+ r2 G4 O/ N       if Collection(vItem) &lt;&gt; "" then
! x0 K( k# S+ G       tbl = AddRow(tbl, vItem, server.HTML5 M+ g5 U) j* d! h
Encode(Collection(vItem))) ' &amp; " {" &amp; TypeName(Collection(vItem)) &amp; "}")
9 c+ L/ ^9 K, t. c' r2 N       else & a/ y/ q3 g6 W# t, ^
       tbl = AddRow(tbl, vItem, "...") # n- o. s  ]% h% F$ u6 R  Z
       end if & t) f. k* q( U2 I! B, b6 u
     end if
. m: y2 j; P7 N" y   end if 8 ]( p/ Q) n9 F: S- I( G* w
   Next , c/ ~: @2 W2 g! V5 O  I0 f5 P* u
   if ExtraInfo &lt;&gt; "" then tbl = tbl &amp; "&lt;TR&gt;&lt;TD COLSPAN=2&gt;&lt;HR&gt;&lt;/TR&gt;" &amp; ExtraInfo
1 l* z3 j' b& v   tbl = MakeTable(tbl) . w+ l8 a; c0 w+ R
   if Collection.count &lt;= 0 then DivSetNo =2 : C8 @. g* C5 _/ m
     tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
. M& [/ N; Y2 J" [" c7 F3 [, p     tbl = replace(tbl,"#sectname#",replace(Name," ",""))
2 c* T, k! ^& x4 w* Y7 y* Q* c, [     Response.Write replace(tbl,"|", vbcrlf)
0 T7 a# Y5 ?; q* HEnd Sub
& u7 K1 _3 r" X$ i4 a! Z  
& |; U) f2 ?; @  G3 H$ F- e3 Q'*********************************************************** ! {& ^# A3 i3 ~
'* AddRow & {6 ^  A. F" n. U+ Q
'***********************************************************   c9 e: h2 }5 e
Private Function AddRow(byval t, byval var, byval val)
$ `5 _: |" n; {1 |) z$ K% |/ l   t = t &amp; "|&lt;TR valign=top&gt;|&lt;TD&gt;|" &amp; var &amp; "|&lt;TD&gt;= " &amp; val &amp; "|&lt;/TR&gt;"
! J# E8 u6 c5 z6 x& S$ }9 Y9 ?  i   AddRow = t
9 h& e# X- _! i6 ]End Function </P><>'*********************************************************** 1 l& x0 o4 F+ {5 H/ u
'* MakeTable
/ ~/ a4 j- X9 ^" ~" L# n'*********************************************************** . J7 `# X, n. o- N8 d
Private Function MakeTable(byval tdata) $ V) `$ z5 t" o# U- H; C, P
   tdata = "|&lt;table border=0 style=""font-size:10pt;font-weight:normal;""&gt;" + tdata + "&lt;/Table&gt;|" + r6 h) v( t! E8 ^3 u, r3 Y+ [$ V) _
   MakeTable = tdata ! t! h/ m( s9 ]/ U2 F
End Function </P><>'***********************************************************
8 P) C+ Z7 z) u0 s9 h1 q''@SDESCRIPTION: Draws the Debug-panel 4 i/ v- U  q9 Q# G/ e% |- Y
'*********************************************************** 1 ^5 g- W0 [' n+ z8 T! q; ^0 [
Public Sub draw() + z% p9 u+ p: ?
   If dbg_Enabled Then , u3 r& T4 X+ ]( T
     dbg_FinishTime = Now() 4 j+ c4 v, X. |
  % e) F/ P0 R# y2 R6 J) t8 N: D% A
   Dim DivSet, x
. U5 J' t5 G2 j9 C. w5 W8 q9 b' y1 R   DivSet = split(dbg_Show_default,",") 9 g0 U8 L$ [9 l9 }. T' Q
     dbg_Show = split(dbg_Show,",")
4 R$ G# |; |9 m7 A+ I4 |5 B  
5 n2 T# W* \0 b! M* d   For x = 0 to ubound(dbg_Show)
4 K% W5 i! `5 T; Y( r: v     divSet(x) = dbg_Show(x)
8 p2 e+ f! A( g0 Q4 g  y   Next
0 w. _; @- p4 |5 |+ ~# _, e  7 l. v. ~% D' p; j4 r% 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;"
  `. a$ E' L) w   Call PrintSummaryInfo(divSet(0))
' b; }  h8 Z$ p) W2 D, @     Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
% w; B$ _; S( |3 p    Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
/ x" s2 L( y) e5 h; ~    Call PrintCollection("FORM", Request.Form(),divSet(3),"") $ B6 i% g% q+ l, ~
    Call PrintCookiesInfo(divSet(4)) ) H9 V- x  c4 R$ }
    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))
3 j$ f0 i+ y8 L, W' J0 B    Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
' ~3 }* s( T, z8 T% V/ J% F* `+ a9 c    Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
3 B+ x* j: }/ G4 H1 Z    Call PrintDatabaseInfo(divSet(8)) 1 j& k3 M1 ]& C1 Q/ T5 x
    Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") + k; B& Z" l# z5 U3 k( Z* @1 `
    Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
6 d- F7 _- u+ H0 {  R8 ]    Response.Write "&lt;/Table&gt;" % X+ v  z5 B$ |; Y  A5 J6 l2 y( e, Z
   End If ) q4 ^' Q3 Z0 J* F' D0 F; z7 D
End Sub </P><>'Destructor
) L* ?0 h7 |8 v1 `2 o' XPrivate Sub Class_Terminate()
# N3 O% R% N+ u4 k5 q* g' ]   Set dbg_Data = Nothing 9 t" ~$ q& O: G# L$ b; V9 Y! V% M
End Sub </P><>End Class </P><>%&gt; </P><>类的说明: </P><>$ c! T( |; B$ G
CLASS debuggingConsole 6 J: K' Q3 N( v! Z$ z, x7 q8 W
Version: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false , R6 D- i- @% j! @+ `
&amp;n7 F2 h. v  U0 w7 V, b- E; b
bsp; & D: Z) a9 [# }7 {! L. |# I5 p
Property Get Enabled===[bool] Gets the "enabled" value # P+ z2 a, _8 ^' S  p. l; D
  - J7 b( C, X+ V$ w5 A4 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 9 g, G  a% j$ ~+ I% V6 e
  
4 v8 D5 H1 l8 }2 [/ jProperty Get Show===[string] Gets the debugging panel.
, E( p+ W5 t9 W; c: @6 B; i: k  
$ |7 ~% y2 v, S1 q) H$ C5 f- |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><>-------------------------------------------------------------------------------- ) p5 o/ B" k3 }9 F# ~
Public Methods </P><>public sub===Print (label, output) : O* D% S5 v' l% M) Z+ W! H, r7 g: q
   Adds a variable to the debug-informations.  </P><>public sub===GrabDatabaseInfo (byval oSQLDB) 7 o  v6 q! B: D* n' v( K" [
   Adds the Database-connection object to the debug-instance. To display Database-information  </P><>public sub===draw () ) ?7 y/ X( u) R$ W& n5 i/ K+ Y
   Draws the Debug-panel  </P><>-------------------------------------------------------------------------------- 8 e8 c/ \0 R& q/ N  @9 i4 `
Methods Detail
$ l: i) j" |# @' G" \) Q  * C7 G4 t! M5 x6 ~$ w- A6 q4 j
public sub===Print (label, output)
6 m( O, V$ e- t' Y7 UParameters:  / N2 N/ {: ?! v& }3 l, V5 u  ~  G' j
   - label [string]: Description of the variable 5 d$ T9 U7 P- `% m9 v- q
   - output [variable]: The variable itself
; m, x/ f  o  |! y  " l1 `1 h" h6 z7 n# p/ O
public sub===GrabDatabaseInfo (byval oSQLDB) # t* i7 K1 O; n* I$ r( ]% x& \
Parameters:  ' @( e' F6 V9 U1 \" a9 J' a
   - 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-8-5 02:45 , Processed in 0.472604 second(s), 56 queries .

回顶部