- 在线时间
- 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"))
) a# V! m9 k3 ] dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) ; x: u# R- w1 [2 f0 \
End Sub < >'*********************************************************** ' N# F) O! z7 ?! D' i) Q4 d
'* PrintDatabaseInfo 2 A* U; A% Y: J5 t+ x; v# V
'***********************************************************
$ F7 V& k* D* Z5 dPrivate Sub PrintDatabaseInfo(byval DivSetNo)
% W; C6 P, x$ `$ ? dim tbl
R' C! q) K9 j3 Q: h* O. [ tbl = MakeTable(dbg_DB_Data)
, I8 C. a$ G; f, w tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) : C3 |0 t7 p0 F; j) z
Response.Write replace(tbl,"|", vbcrlf) / Y* D" [$ {4 C" `8 k
End Sub </P>< >'*********************************************************** 4 N. m7 b/ q2 [& a; A
'* PrintCollection
7 u5 F+ \6 ?& R7 R4 ['***********************************************************
$ E2 j, X I( x4 F) s* p: Z. ]/ APrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) z+ e* ^% E6 k# Y: y- q
Dim vItem, tbl, Temp
3 J1 G4 @ j+ t. g# `# e For Each vItem In Collection * z, D' L Z! q6 o
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ; E+ [* }0 e3 s. _! Y8 K0 f9 p
tbl = AddRow(tbl, vItem, "{object}")
% l$ _ h B2 U8 b* S: e elseif isnull(Collection(vItem)) then ) w3 R& u7 H q C( s
tbl = AddRow(tbl, vItem, "{null}") " t9 R8 k" w. X( I
elseif isarray(Collection(vItem)) then ; }' c0 {0 q7 W" x. U6 \; i9 _ P( o
tbl = AddRow(tbl, vItem, "{array}")
$ c8 x# K: a& f8 d1 x else 9 y7 F! L& A$ [- K" M
if dbg_AllVars then & B7 ~8 _) b2 s# ^
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
3 K, q: M9 K4 g* Y0 H! G! Y. a i elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then ) _7 n8 P6 e3 {, w$ Y2 q6 W
if Collection(vItem) <> "" then
6 x+ z" d. k- g+ W3 `/ ]* q5 h tbl = AddRow(tbl, vItem, server.HTML* t, u: V: g5 q! x0 F# q3 O6 A
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
: f5 U/ x) g: K else 8 S1 G/ Y, u8 A3 i n" Q
tbl = AddRow(tbl, vItem, "...")
- V; g+ d" v" ~+ {% T end if 0 U( m; D* {9 ?& C: F
end if
/ C# U' j! S/ Z. V+ k. f- m; v end if # r6 K; q9 A" V& {3 y# }5 i
Next 2 A' F1 U4 n+ `+ Q& |' f+ [
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo , w s) g: M* W E' A0 ?) S/ V {
tbl = MakeTable(tbl) 8 _! i! |7 J) _3 X/ W. }. f) Y
if Collection.count <= 0 then DivSetNo =2
8 d* [5 x B4 e/ g+ g tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) / C9 }; v& M( e; D0 h/ p9 F
tbl = replace(tbl,"#sectname#",replace(Name," ","")) 3 Q1 f, b- S5 B5 N
Response.Write replace(tbl,"|", vbcrlf) + ], {7 Q! [9 E4 O+ k1 l$ S& V! M
End Sub
. h4 L* ^! a d0 j# S+ j0 d) m 8 [7 e7 ~3 T: z# u# B, V5 h" K( ^
'*********************************************************** . D) u# r4 b; Q, X9 O7 f
'* AddRow . {* C' s% ` m1 X
'***********************************************************
. i( E c4 V! l- v1 x0 cPrivate Function AddRow(byval t, byval var, byval val) , I; k# |5 ^$ p
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
( L. I e. i) ]# W% k D AddRow = t : Q3 Y( v9 o+ p4 { {
End Function </P>< >'***********************************************************
. Z1 [4 ~# s; a: t) M' E'* MakeTable
: U l& f/ _( Y* R4 k2 R'***********************************************************
# R# K5 d( L7 W" n: x) TPrivate Function MakeTable(byval tdata) 9 \7 v" A7 p2 {: U7 B! M/ P" N
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" / `. `& f4 r- F1 x9 S& M
MakeTable = tdata
% W% M0 `9 }" w- c" ^& J5 B" x8 s4 MEnd Function </P>< >'***********************************************************
6 k2 b: {) d* Q" T# ~+ v: r''@SDESCRIPTION: Draws the Debug-panel
( t! L) m/ B1 f+ q9 z/ y9 Y1 E1 q'***********************************************************
3 R0 _ T' z2 S9 a) EPublic Sub draw()
1 f, i9 w2 O) z8 a$ Q7 v+ j6 B/ F) E If dbg_Enabled Then 2 i3 h x" P) T7 L }( J5 J; e
dbg_FinishTime = Now()
. |1 i. X$ b8 R3 r' E* n
( m. Z; \/ K+ i: C Dim DivSet, x
1 s9 t; r, e, h9 E4 Q1 s, T2 e DivSet = split(dbg_Show_default,",") & `9 L C9 J, _; P7 v8 a" L
dbg_Show = split(dbg_Show,",")
* b- G0 r( i7 m# Z) C s 4 n# a( Z/ V' [/ k t( z3 w, _& V
For x = 0 to ubound(dbg_Show)
: H% ^1 R$ S' b6 s4 v divSet(x) = dbg_Show(x) $ h: k: p4 ^9 k
Next
5 P+ m1 }6 H4 e( @2 s5 q 9 z0 L: w! F3 T% {- \/ J
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>" ) \- f. Q0 J8 I8 ~6 D- u
Call PrintSummaryInfo(divSet(0)) 5 B6 o+ S) ~/ m& j
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 2 Z/ C1 I! c" r
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") y. _; o$ l7 D" `. P- v: l
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
- }5 j$ r7 h6 Y' a Call PrintCookiesInfo(divSet(4)) $ L. X& N$ x& O9 N/ `' @
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 O9 N5 W- s8 z+ k' \6 S Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 3 N/ _$ z: G8 |2 y6 `0 p5 t5 F0 X
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) . |! z" V" v+ \: n3 X
Call PrintDatabaseInfo(divSet(8))
4 V, t" y2 F1 e& E5 Q% U- o7 { Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
7 d9 F1 b2 K4 e0 a V/ I Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 8 ^1 W4 c( X# } } C( v
Response.Write "</Table>"
4 y* M8 e" v2 }1 Y9 O End If - r) d8 e; \* N
End Sub </P>< >'Destructor
9 ]; ]4 E9 U4 ?. x) E+ HPrivate Sub Class_Terminate() 9 {" c, z E/ v/ }
Set dbg_Data = Nothing
( e" D8 Z+ z! f) T6 W3 }$ G5 bEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
( r7 P: z& o" e, n+ yCLASS debuggingConsole 8 F2 [: j% P* X& Q5 y6 K
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 N( t! f3 m v&n3 E" N6 B. n6 E. U7 K
bsp; 7 A) o! W; d) z
Property Get Enabled===[bool] Gets the "enabled" value " b# {4 P" Z. T/ M
/ U7 g# Z9 C9 [/ A
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 C S# X- R5 h; ~ / z2 J6 z' P( w% z6 E% \
Property Get Show===[string] Gets the debugging panel.
3 J. Z7 A' k" M, f5 q & |% r2 ?5 O' _- [1 B: e" ~' r3 b
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>< >-------------------------------------------------------------------------------- + ^5 c% D: |: v
Public Methods </P>< >public sub===Print (label, output) , S+ M2 D- T1 B3 h
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 0 `' N( u- N x' c1 g: h) ]
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () , j9 m( M( \$ A! I
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- + ]3 k! f3 l2 _' r8 s4 @( ], q
Methods Detail / E! ~* [6 y K( g. z! X5 t
- z! ?3 w* y5 z/ m: z, P( ypublic sub===Print (label, output)
/ @6 X: j0 n- \$ {1 G" d. ?4 _7 @Parameters:
8 W( z0 ~1 v, A! @3 C2 a" o! g - label [string]: Description of the variable
/ r8 [ e, L' U5 a8 w - output [variable]: The variable itself - f! e3 E3 D5 H# o, J
" U/ ]0 ] b3 H! X" f7 u, @
public sub===GrabDatabaseInfo (byval oSQLDB)
: I6 e4 ^5 |) }7 Q5 C- B# VParameters: " i; D# H& t" u* q+ X
- oSQLDB [object]: connection-object</P> |
|