- 在线时间
- 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")) 2 f" U7 d+ @: Q/ i5 y- z
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
" ^; r, P$ s* e6 ~0 N \& s. GEnd Sub < >'*********************************************************** - q# R# D* d( b( ]+ Q
'* PrintDatabaseInfo ( Z2 T; J& u" w/ D7 s
'***********************************************************
1 h: m, K8 }- i; BPrivate Sub PrintDatabaseInfo(byval DivSetNo)
8 [. @, Q" \1 ]) f5 r/ H s dim tbl 6 q" U6 R7 G# S% m% Z
tbl = MakeTable(dbg_DB_Data)
8 U; N/ [9 y# D6 Y( g tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 9 C& a/ I3 N5 [1 I3 `3 O' z6 n. L; K
Response.Write replace(tbl,"|", vbcrlf) ( m1 m3 O1 ~( w P, g" E3 s, }; c; c
End Sub </P>< >'*********************************************************** ) x" _* z v1 I% u' a y7 i
'* PrintCollection
$ ^8 p4 g' A9 K5 T'*********************************************************** & h$ M6 y; k# _! u& g
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
1 p- V3 y4 _6 q& J Dim vItem, tbl, Temp " d' G% o7 ?+ L3 }) U, V( f$ ?
For Each vItem In Collection
) l2 V: }5 Q- t% I1 R* u if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then : n) D. E; K7 z" f( k7 t9 }
tbl = AddRow(tbl, vItem, "{object}") 7 ?$ @0 ^) t) ~& k5 y! A
elseif isnull(Collection(vItem)) then ' I1 ~4 Z; p6 |, ^( l4 v8 K4 u& e: w
tbl = AddRow(tbl, vItem, "{null}")
; I. o3 u% F* V9 h4 N2 D6 Q7 J/ c) | elseif isarray(Collection(vItem)) then : A* z. F+ j; O% R/ r+ L* v+ L
tbl = AddRow(tbl, vItem, "{array}")
/ B( E p, C* G1 U% Q$ p5 d) Y else
* b7 h. q( ^6 @0 X* } if dbg_AllVars then + t* f4 F# t! g8 W
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
2 }0 b F; q9 q! m" D( o elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
& V0 e; H+ }) T: Z! J7 z if Collection(vItem) <> "" then
% f( w- h. X: C* A/ ~ tbl = AddRow(tbl, vItem, server.HTML5 G# B% V6 U. Y$ F
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
, L2 D; c/ {/ q else
" a& T' }6 q. e) y/ O, ? tbl = AddRow(tbl, vItem, "...")
; ^2 D% y, K) G- U5 G& j end if
1 [1 B/ L. b) y end if
3 X j" O7 \+ n3 ?+ u+ d end if
% _$ U, S+ v" r! k# A Next
0 k6 F# M! x% A. f( f6 v if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
2 E9 C! b' R% Y7 Y" z$ f tbl = MakeTable(tbl) ) N6 ]; M2 [! T8 a- v& `
if Collection.count <= 0 then DivSetNo =2 5 W6 z9 F, b3 _# v; ?/ O; o
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) $ U! G# b% Q2 G0 L% S* R* @
tbl = replace(tbl,"#sectname#",replace(Name," ","")) * W3 [, [- m& ^% b6 Q/ i
Response.Write replace(tbl,"|", vbcrlf)
9 m: Q* F* o% O1 D8 }8 VEnd Sub ) ~8 `5 Q; Q9 g
4 v7 W7 p4 `& L$ T2 q! Y- ]'***********************************************************
" u" e$ ^6 D9 B$ f6 Z! k5 b7 ]'* AddRow , z2 _5 V i" H: p/ m
'***********************************************************
9 k8 P& v$ q4 ^- d1 b' gPrivate Function AddRow(byval t, byval var, byval val)
3 P9 I0 f) Q& O9 }) m# w" c t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
: ^; G6 h' t" B9 D' g0 x2 l- b AddRow = t ! W, j5 u1 T8 A
End Function </P>< >'*********************************************************** % c6 R( I* H4 u* G; T" w$ F- ^8 L
'* MakeTable
6 v- h8 |5 t0 D9 z9 P9 |'***********************************************************
j- D: M) G- [( W* aPrivate Function MakeTable(byval tdata) 4 L. F; u7 q+ q# Z% J2 H* Q
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" ! S1 l" c( r) q0 O! C2 A
MakeTable = tdata
" ~+ d! A8 c; p3 K" q8 nEnd Function </P>< >'*********************************************************** & m6 n* ^! i- T/ N3 U5 P+ j7 k0 Z: ^
''@SDESCRIPTION: Draws the Debug-panel
9 D" _8 o! `2 F6 X'*********************************************************** 7 Q1 F" |: h, g: V- i. k4 g
Public Sub draw()
* O. G& F) K9 Y# y& S" I, y If dbg_Enabled Then # L* t& q" P# @- x- \9 D% y
dbg_FinishTime = Now()
8 L" Q+ [( O+ S; G * ^/ b8 ?3 J! m1 _6 O V" A
Dim DivSet, x
: R& @# F. @ z4 n& p8 s u DivSet = split(dbg_Show_default,",") 4 F$ U4 s+ @) N
dbg_Show = split(dbg_Show,",")
6 {; {3 e6 O+ b4 }6 [ * O9 T- N- N$ C8 v) o
For x = 0 to ubound(dbg_Show)
2 w& w2 x* T- E S divSet(x) = dbg_Show(x)
4 J5 O% V! I+ `, O3 Y Next
1 x. H' r2 k2 m8 n7 z ; I0 ^: |) a/ e5 v9 F5 ?2 Q& L
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>" 6 y% P* F& O& \3 U' G# d
Call PrintSummaryInfo(divSet(0)) 8 z6 [6 k6 m; q# o
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 9 b3 c2 @! ^0 r$ W9 d
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ( u+ ?& I% m% x. G9 {' Y, a
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
* b I8 X8 j' N Call PrintCookiesInfo(divSet(4)) 5 K) ?- ~. A# G1 {3 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)) + ^9 Q+ N1 a) N( Y
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") / `( a' Y# o3 p0 U( i
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
" ?4 o; F! I4 ~2 T* M! f/ B# w+ X Call PrintDatabaseInfo(divSet(8)) 2 w* a. t4 t9 N: M
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") : I1 O. j! G/ M
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
1 T- j& J' W" [ Response.Write "</Table>" 4 b* D8 x. U! A9 \- L7 g
End If 7 G" Q' T! H) _& D9 c
End Sub </P>< >'Destructor
; x6 j3 T( t: H9 l: cPrivate Sub Class_Terminate()
, o/ m& f8 G' z( I2 Z0 y' j) E3 V Set dbg_Data = Nothing . L, h3 `' F" M1 { |# c. `
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >; R' q5 {1 e. z* T' z9 Z0 N v
CLASS debuggingConsole
5 M. V' ~6 @4 wVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false + i, s& f. Z0 T
&n* w% i. c# X# U
bsp;
: _! B. }. T/ [; x& P- aProperty Get Enabled===[bool] Gets the "enabled" value ' a1 x* N! {* A( i# }+ ~" i
' S3 }% r, P$ h& G" h
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 % @# X6 \1 y7 \. n1 i1 V) z, y
: e0 W! A/ c$ Y: U1 J# X4 L
Property Get Show===[string] Gets the debugging panel. ; o% d, j2 ]' l4 N1 X# b3 A
3 n" m w/ t' o3 x2 q) g& E
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>< >-------------------------------------------------------------------------------- : R" E, m5 ]* V( U' h) t
Public Methods </P>< >public sub===Print (label, output) 0 k" b3 y5 U' U
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 0 F0 y# t* h# D* E6 C$ \ Z ^
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () " d! Q; _% @/ P" K. f
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- / }: B( b& s9 I; L. v
Methods Detail
" H( l% X! e+ A, M2 L / |; w1 K* U4 c5 l. l
public sub===Print (label, output) 3 f# I& F1 h" f4 u6 Y
Parameters: " ?. L% y( K/ N
- label [string]: Description of the variable + T% [% v7 i+ x* j
- output [variable]: The variable itself
0 x. H, L$ J: }5 c7 i$ B # D0 c2 I6 F# U$ X
public sub===GrabDatabaseInfo (byval oSQLDB) 2 s! f% h, } N" _# y0 u# |
Parameters:
. X; U. `1 t8 c# Q, \* { - oSQLDB [object]: connection-object</P> |
|