- 在线时间
- 0 小时
- 最后登录
- 2007-9-23
- 注册时间
- 2004-9-10
- 听众数
- 3
- 收听数
- 0
- 能力
- 0 分
- 体力
- 9975 点
- 威望
- 7 点
- 阅读权限
- 150
- 积分
- 4048
- 相册
- 0
- 日志
- 0
- 记录
- 0
- 帖子
- 1893
- 主题
- 823
- 精华
- 2
- 分享
- 0
- 好友
- 0

我的地盘我做主
该用户从未签到
|
(dbg_DB_Data, "DBMS",oSQLDB.Properties("DBMS Name") & " Ver: " & oSQLDB.Properties("DBMS Version")) & C$ F5 V# X# N4 u3 y
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) + I5 I* r& |' j% D, O5 D% U2 e
End Sub < >'***********************************************************
: P3 ^. [1 A6 }7 W% ]'* PrintDatabaseInfo 1 G Z" Q; F1 X5 E* g$ X2 o
'*********************************************************** : L3 |: E6 g% D$ q; U) |" s( Z
Private Sub PrintDatabaseInfo(byval DivSetNo) / q( ]) t; p! f2 K% M
dim tbl 8 j- J7 b [ l- O( E: D1 E
tbl = MakeTable(dbg_DB_Data) # Y% ]+ {$ K/ g
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 4 q$ R8 d' V0 @$ [& @+ k) @3 y
Response.Write replace(tbl,"|", vbcrlf)
- R3 b; Y5 ?) Q: tEnd Sub </P>< >'*********************************************************** 3 N# t4 H# L2 G% l0 I0 _3 ^
'* PrintCollection . P9 q; f% D" d; f7 E
'*********************************************************** " f* [5 A5 W9 l; x& e1 D6 y
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
. |) R) q# A: h B Dim vItem, tbl, Temp
# Y# T- l: T# C6 t3 v; m0 B) Q For Each vItem In Collection ' d" m d. l6 E: K
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
& k$ M$ z5 l2 P2 ^$ U* y tbl = AddRow(tbl, vItem, "{object}") ( }3 ^. L9 G, M& D4 n8 p
elseif isnull(Collection(vItem)) then
5 a& q4 _ n2 |# {4 I1 g) Q tbl = AddRow(tbl, vItem, "{null}")
X, ^- n. t7 D8 _ elseif isarray(Collection(vItem)) then
1 ]( ? w7 m+ V8 g tbl = AddRow(tbl, vItem, "{array}") - D5 M9 O/ \3 h5 E) ?
else 8 y7 t4 K, ]2 P1 @+ o
if dbg_AllVars then # h w2 G4 ?7 g( S
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) . n+ k' O" _' q
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
3 d) c( Q: p. c- a if Collection(vItem) <> "" then % y+ Y) f* B7 c) {
tbl = AddRow(tbl, vItem, server.HTML
% Z# n2 l# V/ E r/ @) fEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
' L/ V. j4 f5 ~ else ! f; ~# y' o1 @1 f* t# j0 ]
tbl = AddRow(tbl, vItem, "...")
: H4 c2 b& H: ^# e+ |/ l/ K end if $ [5 Q+ G. [" n+ ?
end if . I, i+ n8 K, z# b
end if
" A" f0 w+ |5 S- E. a5 B Next + `% d8 ?) o" j6 S/ [ q, K4 F
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
% d, H5 m9 M% p; S' | tbl = MakeTable(tbl) # |, B; z2 O8 x; q5 {
if Collection.count <= 0 then DivSetNo =2 6 p/ f6 e- I8 Y2 n0 `2 D
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) & A t. }2 \( E" R
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
3 E" Q+ c, q+ u. |( D Response.Write replace(tbl,"|", vbcrlf)
$ L# K+ J( [ T$ e" w# aEnd Sub
) ^; m7 \3 e' N* y" K/ _ |1 w+ j" J- e: u9 h2 `9 b
'***********************************************************
3 X& z: R4 A+ N- p0 F- [+ \'* AddRow ) _8 Z+ c& q3 k3 R: f9 P& c
'***********************************************************
) u4 y$ A- m- s9 a7 n, |; ?Private Function AddRow(byval t, byval var, byval val)
, ~2 t0 ^# L: o t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" I* U( X4 g) w+ G9 u' j
AddRow = t
}& x; w+ W2 P( Z. G0 U5 d1 kEnd Function </P>< >'***********************************************************
8 M, K4 _( n6 O* D0 L) I4 ?'* MakeTable
/ P4 `+ _" }! R: h& z0 i+ D'***********************************************************
& F% [1 Q( ~: T6 R8 h% qPrivate Function MakeTable(byval tdata)
# i+ @2 f1 d3 F: Y5 g- }' Y8 k tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 7 |0 M8 o1 B/ f1 b7 z- P! ~
MakeTable = tdata , n9 G9 h4 I4 B7 E4 o# ~
End Function </P>< >'***********************************************************
4 w0 N- d$ C. a* ]0 j) B4 D''@SDESCRIPTION: Draws the Debug-panel 2 V- U4 @; p( Q+ n# f* `2 D) h" j
'*********************************************************** ( X: [( G8 j' L* X. p% `+ Y
Public Sub draw()
: ]7 q3 ^, t7 x- n9 K If dbg_Enabled Then : F" d/ |, q9 C; [# U8 Y+ W
dbg_FinishTime = Now()
o6 `; X" p, |& F$ n: L a; I D: E1 ~ d7 K+ Q, [6 K( s% \/ a
Dim DivSet, x
8 Y, w# |& c% p5 h; K) V DivSet = split(dbg_Show_default,",") : k6 d a* n6 B) l8 }8 ^" y
dbg_Show = split(dbg_Show,",") $ }$ Y" {$ w0 Z, ?5 _
; m! S! w3 M; g0 \3 J For x = 0 to ubound(dbg_Show)
3 f, \% O# k& t5 J. i ~* e+ { divSet(x) = dbg_Show(x) " R0 w0 S8 i3 l' c' w- U
Next
1 \( I$ H8 z! | k' t+ m + J( A% T! Y+ Z- g2 Z7 G, p
Response.Write "<BR><Table width=100% cellspacing=0 border=0 style=""font-family:arial;font-size:9pt;font-weight:normal;""><TR><TD><DIV style=""background:#005A9E;color:white;padding:4;font-size:12pt;font-weight:bold;"">Debugging-console:</DIV>"
4 o% |* a. Y+ U, A/ V) Y Call PrintSummaryInfo(divSet(0))
& C0 _7 @: ]2 O. G7 f1 a# v- \& r Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
2 @3 C' @0 X4 C. H% c! [4 a( A Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
/ z$ l% i+ p8 ^$ Q* K2 F4 r Call PrintCollection("FORM", Request.Form(),divSet(3),"") ! Q( Y# e0 n( O' ^2 E4 ?0 v
Call PrintCookiesInfo(divSet(4))
2 z1 F, E( R) U8 V) b Call PrintCollection("SESSION", Session.Contents(),divSet(5),AddRow(AddRow(AddRow("","Locale ID",Session.LCID & " (&H" & Hex(Session.LCID) & ")"),"Code Page",Session.CodePage),"Session ID",Session.SessionID)) " J; ~5 ~" x+ {) I
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
7 x% }% ]* ?) X, A- Y Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
2 {6 L" X; W6 F) z Call PrintDatabaseInfo(divSet(8)) ' o5 r0 ?6 ?2 c4 u6 q& U8 T" k
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
2 [% U9 l/ Z ?$ t Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
, i M/ N+ c" G t4 [' R; E Response.Write "</Table>" ' C8 s5 K& T; q7 F- i
End If
0 S1 h4 Y5 i. X9 zEnd Sub </P>< >'Destructor 7 `/ N# _$ z9 ?; X |
Private Sub Class_Terminate()
% G% y. C+ M6 I; s3 P8 \ Set dbg_Data = Nothing
' i+ ]7 j! ~' l- a) @8 D+ uEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
7 f5 ?2 t: W2 ]4 e; C2 S1 ZCLASS debuggingConsole
: i; S6 k; O: u, z0 @" B) UVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 4 f5 M0 b8 A4 S1 s% ^# g
&n
0 N& z' M' G$ F! k/ jbsp; 9 P$ x+ h3 D0 r5 B4 `2 n& }
Property Get Enabled===[bool] Gets the "enabled" value
) A" x7 _" @4 @) ]. E& o $ b3 s: h/ O2 `' k: j4 O1 o
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 1 N) E' V" u! _" W! L( ^
, o2 ?( f) h( p
Property Get Show===[string] Gets the debugging panel.
5 a& X( e) S9 E# a, g1 ]1 t& Z
' q4 a) G8 u' D5 V9 ZProperty 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>< >--------------------------------------------------------------------------------
. c! y j6 O% [% zPublic Methods </P>< >public sub===Print (label, output)
4 u5 I: ~5 V5 M o Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
3 E% t( a' l: _6 S Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
# U/ I" W% g o1 T/ f+ Y% n Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
/ T2 a* c+ |- L- ~% tMethods Detail : K7 \0 p C% F4 y' J8 n r
; |% ^) c8 H0 W+ X" w" [$ f5 A1 {
public sub===Print (label, output) X5 w( @, F; v- Y4 A6 ]
Parameters: ' x4 k/ H; j3 s T
- label [string]: Description of the variable
8 \6 h7 G! b1 c% j* t/ O, v - output [variable]: The variable itself
8 H/ l m; H) G0 V0 e' j$ | & r9 [ ?$ b$ g# L0 i* W4 h
public sub===GrabDatabaseInfo (byval oSQLDB) , L1 c- B9 ]' i* A& q/ {( c. L
Parameters:
# K- j7 V# x. a* x - oSQLDB [object]: connection-object</P> |
|