- 在线时间
- 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"))
& J( ?1 I& [6 ~1 T, ^% w& b6 w: U dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) ' S7 T; }! J( u5 \4 p- q0 \, `
End Sub < >'*********************************************************** L$ O5 q# K( i/ w
'* PrintDatabaseInfo 0 W: V1 h; t4 s1 j5 J$ B1 [
'*********************************************************** 7 f/ x7 B! U3 E
Private Sub PrintDatabaseInfo(byval DivSetNo)
/ `$ Y8 ^4 W0 `3 C4 D4 E dim tbl 4 D: K# A; e7 K3 ~4 |3 D( {
tbl = MakeTable(dbg_DB_Data)
; B; I2 ^- p8 P" G* P+ o( ] tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
; q! k3 y# Z) U* N& i- u& M3 k2 m Response.Write replace(tbl,"|", vbcrlf) - c6 j# t* Z3 ~' v8 i" l
End Sub </P>< >'*********************************************************** + K6 r6 }# K# t% T( U
'* PrintCollection
$ P6 [* a3 O% ['*********************************************************** $ j' ]! Z$ h% Z
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) + @, V B3 [1 t: _0 W) q8 T j" O
Dim vItem, tbl, Temp
8 i# J3 O1 Y; t! }0 }) L$ b For Each vItem In Collection / B3 u& k& g9 f6 F& P& V
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
$ C1 [9 P- \/ @6 Q, [( c6 w tbl = AddRow(tbl, vItem, "{object}")
9 r& {; V% m# o' J) } elseif isnull(Collection(vItem)) then
9 _) T, s7 M& N! f6 H8 s tbl = AddRow(tbl, vItem, "{null}") 2 j) X% ?& E( ]9 ?6 V" f
elseif isarray(Collection(vItem)) then
0 l" D7 z& {4 |# F9 Q tbl = AddRow(tbl, vItem, "{array}")
' a# V; B0 x- i. t7 t, a# f else . }( J0 }, P, g; l* n) p# L
if dbg_AllVars then
- w: s$ p( |7 z; z) f tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 2 L7 ^# t U) Q: {6 z0 ^
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 5 I* z. d3 Z$ g
if Collection(vItem) <> "" then 4 y& o0 }4 O" i+ |: Y! L) v+ N+ t
tbl = AddRow(tbl, vItem, server.HTML8 K, m8 C6 y7 t: z# |% G3 g
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") * F. t& Y9 p. ^% _, V
else 6 ~/ ?* g0 S' h. j+ _* F$ X! \7 d: F- p
tbl = AddRow(tbl, vItem, "...") ( g1 S: s) N2 n. ?. K" Z
end if
' h* @9 j& M0 F! A: C, \4 ~ end if
0 B& h( i! S, U P- w9 [. v4 E end if / Q0 ~ o/ d/ k; u, S
Next
$ J& U$ Z' Q' ] if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo - M$ Z2 X1 Z. v& R5 Q% C
tbl = MakeTable(tbl) : n8 Z: I X3 y- @6 l
if Collection.count <= 0 then DivSetNo =2
+ k( n* C( l/ K7 `8 `4 L6 U tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
# @( x+ E5 h* f9 H tbl = replace(tbl,"#sectname#",replace(Name," ","")) 4 o# k3 w3 i1 j+ n: y$ h
Response.Write replace(tbl,"|", vbcrlf) & ^3 c! \" K+ K: L5 v) I
End Sub , a0 r4 u8 u/ M+ O5 v
% L/ R% m0 r8 q. u% p
'*********************************************************** + d' J7 ]/ y. p( [6 R
'* AddRow + n( P" ^: Q; X1 v% g2 ]% `2 b
'***********************************************************
% ^ v) F4 s/ c4 mPrivate Function AddRow(byval t, byval var, byval val)
# w( F7 G2 o- U1 U: V3 H t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" ! M0 E7 z( s9 J* `( Z% d
AddRow = t . r( t* [% X0 {7 M: ?: r. p# _: w, A' E
End Function </P>< >'*********************************************************** : p# I$ o2 d1 S$ ^5 f! W4 o0 t
'* MakeTable
# ^% r) p& M+ y* P% j6 {'***********************************************************
7 X" b9 z0 Z e' qPrivate Function MakeTable(byval tdata) : C3 X7 Q9 ]- s! c$ g; v
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" + p) j6 X6 r9 W T1 M
MakeTable = tdata ) x& ^. c. ]. v5 W8 N; P
End Function </P>< >'***********************************************************
J6 Q/ D, `3 H+ X6 T''@SDESCRIPTION: Draws the Debug-panel
. U9 x$ E7 c5 f5 A' P'*********************************************************** 2 C: }, x7 l2 d) D$ R
Public Sub draw() ! ?: K0 n" u0 a7 U v3 _9 P
If dbg_Enabled Then
$ |# V3 S# ^9 p% [ dbg_FinishTime = Now() 1 ?) ?( t, |/ [. F3 `
3 I( C* l8 B2 l& E) u6 p! D
Dim DivSet, x
( D) z4 J* n+ P' V5 L! u: @ DivSet = split(dbg_Show_default,",")
2 q7 j) `' E* H6 N& @8 L dbg_Show = split(dbg_Show,",") 4 i0 M' Z- J ^) K" C" s& _
( w2 B4 z3 e( e, J% i3 J- Z
For x = 0 to ubound(dbg_Show) 4 d2 [1 Y8 S0 X4 M8 p
divSet(x) = dbg_Show(x) " y# N# ~( c. O4 Q: h' N0 R/ W
Next
, \( M5 I* O( ?* A) X2 H' W# {
+ j! r! a! `0 ^- s/ q6 N 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>" + q3 q0 n; d0 j
Call PrintSummaryInfo(divSet(0))
; {* W6 g5 U3 _" U% G5 {) Q# r0 ^- c Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") a8 K { Q C
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
- o( z& a& D6 E Call PrintCollection("FORM", Request.Form(),divSet(3),"") " ]% C, j1 g: L/ |1 Y
Call PrintCookiesInfo(divSet(4)) ' E- E' {& _0 d
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)) 8 a& d5 T5 |5 V/ j/ u" x) k
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") % C3 I9 Q* x! P0 L9 x7 u
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) , R+ w c Z3 N2 M
Call PrintDatabaseInfo(divSet(8))
( [) ~& P2 Q8 {" r# |- d Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
( T8 {: z: d- X: a ^5 q' k Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
$ t3 m- P+ v& L! Q9 D Response.Write "</Table>"
' T, O3 o* R/ S& @! |) p& s2 t End If 8 b/ ]5 W0 ]: D$ K- P% w
End Sub </P>< >'Destructor
4 V' z, {$ f4 k' P" Q1 s+ ePrivate Sub Class_Terminate()
) w/ S B5 x4 J; F9 S1 M) d Set dbg_Data = Nothing 9 y: s* V, `8 y' C9 B5 b7 F
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
2 v+ \4 q% z. ^% J" f/ A! h1 VCLASS debuggingConsole ! W4 j6 N- O8 Z1 H- i# m* L3 M
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " J) n3 W0 l5 p0 c
&n
! V& o; S* V$ N* x( k6 p- |" Tbsp; $ |8 f5 A0 O" A) o+ z; v
Property Get Enabled===[bool] Gets the "enabled" value . ^4 U0 z# B9 d8 n/ g
+ E8 j* ^5 G2 e1 g. Q: UProperty 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
3 ?; S0 T0 G0 F8 M
1 c, p5 H( `$ V/ `: JProperty Get Show===[string] Gets the debugging panel. % F( i& [3 s" |, n8 l
5 _& \, a7 X/ U! B/ v/ C* }' D
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>< >-------------------------------------------------------------------------------- ) i3 |* ^6 z' y3 C3 B+ W! q
Public Methods </P>< >public sub===Print (label, output) : L$ R- \# L- T& }/ X
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
1 [. o, R4 V9 M* x ` Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
7 C9 U* e5 e7 z5 {9 E9 ] Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 3 d. K0 G w1 `' |; z2 V
Methods Detail
# D5 |5 q5 k6 u- Z* p % _ k6 ]! V/ Y+ p# X1 [/ n/ ?6 n
public sub===Print (label, output) 9 T' G0 W% r. l, q5 _$ P
Parameters: ) k3 |1 E7 K& H- f
- label [string]: Description of the variable ! h) h& j" H7 E; W& B0 B4 w+ ]" ^
- output [variable]: The variable itself % n ?: c4 W" w6 Z6 p0 y* X( W: s
7 r! M; {1 }# Rpublic sub===GrabDatabaseInfo (byval oSQLDB) 3 \, f* X# M2 s. V3 J6 [* R
Parameters:
# g6 n' W, F* ]$ i! K - oSQLDB [object]: connection-object</P> |
|