- 在线时间
- 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")) ' J8 Y2 h5 K3 z% m% T2 B
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
5 @1 X! A, P2 M3 z# j- n4 T6 ~End Sub < >'*********************************************************** 2 F/ ^0 g7 c8 V# d( \
'* PrintDatabaseInfo
5 W, E; T* S+ y$ a'*********************************************************** ( K$ Q; U" ^- ]2 W
Private Sub PrintDatabaseInfo(byval DivSetNo)
! x) e, B4 u G( O* ` dim tbl
+ q7 e1 l- P, q+ f tbl = MakeTable(dbg_DB_Data)
8 k7 T# P% m9 \- \ tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ' z5 k. S) z" d: }2 L& Y% {7 p9 h
Response.Write replace(tbl,"|", vbcrlf)
. N, v2 [' q+ k# CEnd Sub </P>< >'*********************************************************** ) X! v* A8 a9 d; U! |
'* PrintCollection 4 [) a+ J" e, F
'*********************************************************** 4 M d6 o" Y. p
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
v; C0 }! G: M B Dim vItem, tbl, Temp - n. h9 _0 H/ Y2 i! P6 a' i6 Y
For Each vItem In Collection
. K W: u1 j6 S& [% R" b4 C; S if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
: U p3 ~7 B* Z [3 Y& q% K tbl = AddRow(tbl, vItem, "{object}")
5 K' f# Q0 I$ C8 X' x elseif isnull(Collection(vItem)) then ( C7 B, h* p* T8 [* i6 @) P/ _
tbl = AddRow(tbl, vItem, "{null}") % F& D% p. r5 ^6 d% d' Q- g
elseif isarray(Collection(vItem)) then . j: d% T# k' Y
tbl = AddRow(tbl, vItem, "{array}")
1 g5 \- H; N0 q8 r. {7 e4 @ j else
& [/ S8 j5 f: z% v if dbg_AllVars then * P# [ c, M+ Z5 ?- Q
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 8 L" _4 H: d& r
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
1 ^4 c: ^; v0 H/ { if Collection(vItem) <> "" then . t$ e) T7 h8 `5 |& S7 z) `! E
tbl = AddRow(tbl, vItem, server.HTML
) Z5 }, C8 w8 L6 e- O, k: KEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") # c# ^& Z% p+ K, I
else
# f2 H% W% J1 L tbl = AddRow(tbl, vItem, "...")
9 \$ n+ x! |. m: M' N6 P# r end if
' r! Z( ]1 k4 f2 | end if
2 r/ I, z$ I! O" D" M end if 0 h# p" q) H+ I" b% }
Next ( X: W* c8 K. I' J8 p
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
/ D, w# q2 s5 `5 @; [1 _ tbl = MakeTable(tbl)
, R2 |9 r g& ]+ p; z: ~2 g if Collection.count <= 0 then DivSetNo =2 3 V" ~ X+ u/ G/ g5 Y
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) : l: p) f- P! l( O/ y5 z D' O& |1 S) [
tbl = replace(tbl,"#sectname#",replace(Name," ","")) * g" X% n" A% i5 v
Response.Write replace(tbl,"|", vbcrlf)
% _ M- x; l) f2 m- {End Sub . I1 l* c+ l( m+ _1 q
0 e4 C5 i) W$ U" v4 M3 h! h
'***********************************************************
( r# x0 K( N' @ H8 H! u5 {: c" S'* AddRow 1 l+ _& m, ?2 v* |$ c2 o& G/ L2 C
'*********************************************************** 1 ?' Z+ |' g# h( Q3 C8 \% n
Private Function AddRow(byval t, byval var, byval val)
4 G9 t6 y1 X9 `+ z6 I; n c t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" ( y+ N2 \( B2 w- b
AddRow = t
4 x6 V! C! E; b7 t. f4 kEnd Function </P>< >'*********************************************************** / o7 n. C+ T5 H+ ]3 b7 f8 z6 t
'* MakeTable & R b/ ?! Z" w) W
'*********************************************************** / k2 g0 v6 D- L- \! {1 G% ~/ p
Private Function MakeTable(byval tdata)
1 u$ K8 k1 `9 N9 @' b. }0 e tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
/ }! d( v. ~( g. F, Z& | MakeTable = tdata
! p7 |8 x! q0 y2 @End Function </P>< >'*********************************************************** ! d/ Y9 I. D0 L; q/ S
''@SDESCRIPTION: Draws the Debug-panel
6 R8 D4 P3 n Y) I/ y9 D'*********************************************************** 4 X' K" K ^8 ` Y. {+ \
Public Sub draw()
. y1 r1 E! M! F+ \9 K H If dbg_Enabled Then
5 T9 q4 F% Z! @3 i dbg_FinishTime = Now() ) G# f5 _9 M# m; i- U4 j Q. V
" Z7 A S% J) ~+ W6 Q4 F* d Dim DivSet, x ; u1 ~4 B7 q5 S C. g
DivSet = split(dbg_Show_default,",")
6 P* R, d0 P2 G) l3 Q1 S dbg_Show = split(dbg_Show,",")
5 r5 l7 s D k+ m" c 6 ^$ d' \8 m; [- q q% T2 p; O
For x = 0 to ubound(dbg_Show)
# R# c3 v+ c' n& B0 M divSet(x) = dbg_Show(x)
% ]/ N$ A9 a: t$ U* P Next 0 y7 |5 L2 p2 {
; \; Q- k- I. O! u1 u1 t
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>"
5 s8 M: T4 t) ]! L0 M Call PrintSummaryInfo(divSet(0))
) \) S6 `1 M/ n& _$ i5 d Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
]: A/ s* p) V5 A Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
5 q$ k d% R, F1 Z6 W* A+ z4 ^4 ? Call PrintCollection("FORM", Request.Form(),divSet(3),"") - k4 U& ]2 c( w; }2 L3 y
Call PrintCookiesInfo(divSet(4))
# B2 o7 X% z2 V, A/ E; q 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)) 1 n9 T) ]; P3 }2 d" {% A s( c
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 5 m. C+ ^" l! B, \4 H/ P3 N- ]7 A
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) % j8 b7 D3 \$ N
Call PrintDatabaseInfo(divSet(8))
/ r4 h" \* J; c) H5 V Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 7 c# z. `2 K( N9 M3 R
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 2 l0 F; b* L1 |+ ]
Response.Write "</Table>"
2 \, g4 h2 J7 [- ?. B1 _ End If
; A# V6 x# F8 V$ B/ gEnd Sub </P>< >'Destructor
: \. Y" X, J* w3 R vPrivate Sub Class_Terminate() 2 @; T1 r, Y8 p% s( v8 d @$ d
Set dbg_Data = Nothing ' D$ ^' V& V% A9 `
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
* \$ s8 c, x' G2 Y& JCLASS debuggingConsole - q% ^" F3 e9 t# z
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
* m' ^; h& [/ Q8 e- [&n2 |. `1 y9 S, [* c. ^& n
bsp; 1 L$ F, @. K/ e. D0 A2 s# ]) \
Property Get Enabled===[bool] Gets the "enabled" value & |0 K6 I4 e* p# B' P" Q
8 M5 ]; W$ g) I. s2 HProperty 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
2 M* B" X! g0 Y8 L6 }- X7 V : ], o/ r. h* C
Property Get Show===[string] Gets the debugging panel.
% Z! X' T& c0 J6 i2 i 2 t- T8 L0 L; t/ |% u8 G i' J, ]! u
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>< >-------------------------------------------------------------------------------- / t1 }+ k; Q" s. C4 |/ Z6 ?
Public Methods </P>< >public sub===Print (label, output) 6 ~2 m# O7 r9 t! c3 T% \$ n4 R- }
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 3 A! O- ^) y9 }5 k) [! `( e
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
' m2 P/ ^! ~; A( K/ l0 a( { Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 4 G( ?( a% U1 g8 ?: E9 C6 ]
Methods Detail 8 H1 C! H1 _& U P
. m5 ?% x% P9 G+ z. K5 E. cpublic sub===Print (label, output)
4 g5 f6 b7 R6 B1 MParameters: 2 p. ~1 {% [; E" P5 v. {& S3 L
- label [string]: Description of the variable + ^1 p$ x* i2 Z
- output [variable]: The variable itself 6 o% D7 V7 u4 j- k1 { T
8 e1 Q" {8 `+ m# J( U: W
public sub===GrabDatabaseInfo (byval oSQLDB) 7 c- J/ ]3 ~' U+ Z! Q
Parameters:
1 l% A7 @. G1 w. s7 f( \& r - oSQLDB [object]: connection-object</P> |
|