- 在线时间
- 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"))
; e6 f( `; \0 M0 M dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) 2 S8 U. u6 C1 m3 ?. p
End Sub < >'***********************************************************
, [# Z# u5 K/ z0 x7 ^* h'* PrintDatabaseInfo
$ _8 @: u; B# [6 g/ A8 d B'***********************************************************
: ~* p# P# R% jPrivate Sub PrintDatabaseInfo(byval DivSetNo)
2 x/ K( @# V5 U3 ~0 J& b dim tbl
. J& ]/ s& F E0 v' r5 o' {* H tbl = MakeTable(dbg_DB_Data)
* S9 M+ k8 i, o# B3 B/ `: b$ T tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
6 B; U+ n( y! I' m( n Response.Write replace(tbl,"|", vbcrlf) . M: r1 Z! {1 [# D6 G' T
End Sub </P>< >'***********************************************************
* L! {0 a" D# P) i, O'* PrintCollection
0 B* A6 g7 r' Z+ G* X'***********************************************************
: p' R: F! p) {9 G% u( p7 sPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) - h% [: x# K" ]
Dim vItem, tbl, Temp 1 Y) O. R3 {4 k' c8 C/ e
For Each vItem In Collection ! C: C3 ^- k0 E
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
7 G" [9 M8 j {' H tbl = AddRow(tbl, vItem, "{object}")
a7 f: w! i" H elseif isnull(Collection(vItem)) then
' c+ X( }7 A' g tbl = AddRow(tbl, vItem, "{null}")
`5 |5 }& S. R6 K4 A6 k elseif isarray(Collection(vItem)) then ' I% k8 h; V$ f4 r- Q
tbl = AddRow(tbl, vItem, "{array}") & f; y% A/ O( ~3 X6 o
else
; V/ e, O3 g( H% J7 C8 Y if dbg_AllVars then " c* y+ s" H8 E5 n: J) _! S7 L
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 6 @, E, E' e$ ^8 H) D6 x$ E
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then . c( Y5 H( `& ?3 x8 e% x
if Collection(vItem) <> "" then
! D; Q: l+ ~. E tbl = AddRow(tbl, vItem, server.HTML+ \) D) v% g/ U# Y8 h1 K
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") : {: }7 Z4 C5 r' I8 \7 g/ Y
else 4 E% d( J* e1 r* i) E1 v
tbl = AddRow(tbl, vItem, "...") 5 x8 Q( W: L4 \( m& v; \* ]4 d
end if
' T9 [ W' |" F end if
6 J8 C" @. D" S! Y end if 4 w) [7 w8 W1 u. [1 y
Next
: v" ]5 \9 t/ f( _( B' b if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
G$ _$ q5 z3 q! Y4 \9 R tbl = MakeTable(tbl)
6 a1 k& ]$ a/ P3 m# ? if Collection.count <= 0 then DivSetNo =2
: f+ j6 X, n6 @$ K( D* U' ~ tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
( ~4 U# [% N$ A6 g- v tbl = replace(tbl,"#sectname#",replace(Name," ","")) 4 m6 K; [" l% k1 o0 [* {1 B
Response.Write replace(tbl,"|", vbcrlf) 5 T# J4 }( i7 y0 f
End Sub
$ j; i+ M" w1 `5 i/ C+ i- O$ q) m& E
0 z( U4 @% v% z'***********************************************************
" d- P2 g7 g) n! L'* AddRow
& ?. g5 D4 m! t: q* l9 K- g'*********************************************************** - g9 H: {6 C5 |3 L( _, I" n: D
Private Function AddRow(byval t, byval var, byval val) . m! `5 z8 j1 B, D* T! X) t
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
8 H3 D) j4 M9 n! f& N; M5 r AddRow = t
, F5 K/ l6 z/ R' UEnd Function </P>< >'***********************************************************
' c5 r6 N: `7 v; d% p% j% {% M& g'* MakeTable % n9 B& Y1 y/ L& m. X3 n) D9 \
'*********************************************************** 6 T }5 }! J7 m4 c( ?3 c+ z' P. h' W
Private Function MakeTable(byval tdata) 2 _* A ~. Z* t% i- k7 G
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" ) A1 ~6 m7 Z9 @
MakeTable = tdata
/ J( T, }' r3 v* j" Q% mEnd Function </P>< >'*********************************************************** 5 F9 X# v; a+ F+ Q4 I
''@SDESCRIPTION: Draws the Debug-panel
: Z9 ]+ d5 d$ S: J% ['***********************************************************
+ A! v, r1 u, A8 b+ m% h$ mPublic Sub draw() ~+ H$ W2 u, i+ N, J; m8 n
If dbg_Enabled Then 7 q# J* v: N; c0 m7 N& @4 [
dbg_FinishTime = Now()
4 H# \$ z5 C( F9 T6 ^& Z
) R, r( p$ a# I& x( U8 d" O" ]% w Dim DivSet, x
$ x4 F: r& m5 G- v* N* w6 ? DivSet = split(dbg_Show_default,",")
/ @7 S" S/ g+ Z2 }# a dbg_Show = split(dbg_Show,",") 9 }0 c( r/ A ^& ^# U% w& y/ V
, u9 G" h+ _4 s For x = 0 to ubound(dbg_Show) . _) {" G; y, m
divSet(x) = dbg_Show(x)
$ \; o2 \3 y3 M2 R, f* p7 e Next 6 q2 B p& _ t5 P6 f
8 B2 C, d$ T+ `: a6 H( b 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>" $ Z/ I Z: P4 j7 N0 P
Call PrintSummaryInfo(divSet(0)) 0 ]" B# R* d' T1 v9 A. o
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 4 m" d) @5 ^6 @: I* j, x8 Y) I
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 1 @+ K, @) j' J! ^
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
8 s" _* ~- t4 N' D5 _9 |2 W" O Call PrintCookiesInfo(divSet(4)) ; C; A' ]% |: Z. I, W4 Q* `; o# H" z* j
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)) ( ~/ P& o) J! o; X) Y% w+ u0 S: g
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") : B6 d' {) I5 c
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 8 a1 X! g! b5 r5 y
Call PrintDatabaseInfo(divSet(8)) / N s9 i! f# q
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 5 Z+ m+ O" }) h0 D
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
' B5 Z- n, L. i8 |/ r: ]' j Response.Write "</Table>" / O+ V P! R' V* d* B
End If
: N9 L. |! k! k) w8 P( FEnd Sub </P>< >'Destructor 2 f+ q& K3 C! k/ |' f" Q1 U
Private Sub Class_Terminate() * p+ x, R. `. ~% a+ ~' E4 b
Set dbg_Data = Nothing $ o2 w1 N% Y& o# {6 U$ m
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >& r" G$ Z- ^3 z% {7 r/ e. Q. H( r3 m
CLASS debuggingConsole
% S, ?6 {9 e# }. v# C( p/ O/ NVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false . W* _2 ~: L( N0 {
&n3 k# V' @4 w/ D
bsp;
% Q& }+ h$ |! s1 m, q$ q M' d5 j2 qProperty Get Enabled===[bool] Gets the "enabled" value 6 `2 L; _5 y: |8 \' y' \+ J
) B) Z, h: I9 f( d C- WProperty 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
7 S( [, I3 s2 ~; {4 `0 @# H 5 _& G$ A: h& D9 j1 `2 V5 l
Property Get Show===[string] Gets the debugging panel.
3 h9 Z* ?. ?' [0 z! p: g
% C( K+ g& G4 s U9 C- }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>< >-------------------------------------------------------------------------------- / S9 W( s m' P0 N; V5 \6 h1 q8 ~
Public Methods </P>< >public sub===Print (label, output) 5 o- O; h( y+ |
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
7 d) U$ N5 F9 p; g2 ` Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
/ T$ x& B: x7 k9 v Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
& w: I: C0 O, n4 {& d) QMethods Detail 6 K9 X# n+ c- T: G4 w
0 m$ u) Y9 E! Z1 Y6 P. lpublic sub===Print (label, output) ) B$ A8 C( l- J' E
Parameters: 4 z! E5 D! `. B$ ^8 Q! m
- label [string]: Description of the variable ' o1 F; r3 k7 v' x# @- E; I
- output [variable]: The variable itself $ n- u* }: T- i5 H& ^
8 x0 D J1 d- ^* t/ z0 gpublic sub===GrabDatabaseInfo (byval oSQLDB) / A' f( Y% u) L. j+ d9 I: m
Parameters:
- c6 d5 I6 Z+ ] - oSQLDB [object]: connection-object</P> |
|