- 在线时间
- 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")) 5 ^3 V2 s5 ~' W$ M( {
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
; i* G/ ~& X- REnd Sub < >'*********************************************************** $ c" [" y4 L, F h ]
'* PrintDatabaseInfo ) F- r' k6 t# Q
'***********************************************************
8 Z) y0 I% X- }' E) E; g* v! V& ZPrivate Sub PrintDatabaseInfo(byval DivSetNo)
7 a- |; h( H* t& Q2 G* x) K- T dim tbl ( R# M: M' F' \- n/ P% i7 u! m( L
tbl = MakeTable(dbg_DB_Data)
* g+ ?( c' n- }2 a tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
) }" p3 o& o- \3 D, l Response.Write replace(tbl,"|", vbcrlf)
! }8 x5 w1 H' \3 Z& XEnd Sub </P>< >'*********************************************************** 3 x9 @7 q a) ^$ r
'* PrintCollection " D8 s9 n9 N5 Y; N, e
'***********************************************************
+ I* L, S% X& I3 C; m" H9 F, fPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
. y; H% Y9 e( ]* B Dim vItem, tbl, Temp ! j6 C( y1 c) d3 u+ G( M- q
For Each vItem In Collection
7 O( C0 m. o, c% p if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ' Q9 _. |0 [$ _4 p" I( f1 |
tbl = AddRow(tbl, vItem, "{object}")
: {$ l( Q$ R5 ?$ y4 ]! [ elseif isnull(Collection(vItem)) then
4 L# _1 u0 h! J$ ~$ j tbl = AddRow(tbl, vItem, "{null}")
1 H2 {( i# G2 Z5 D elseif isarray(Collection(vItem)) then
, u- |4 c0 }, j& y( L tbl = AddRow(tbl, vItem, "{array}")
c9 f- U& q) O) b& ? else
2 X& u& D8 K2 Q7 z) E0 G$ o# C if dbg_AllVars then $ v ?: c1 e1 h- r8 H; h
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
( O' B D; x3 s0 f7 L elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 1 `" m; D4 ?* y0 n0 j- y' Z& f3 @
if Collection(vItem) <> "" then
+ ^% o4 Q3 m3 t* _4 R6 X$ Z8 x tbl = AddRow(tbl, vItem, server.HTML" v! W+ @6 D+ J2 p
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") + L- G3 @8 @) X9 \
else ( Y5 v! e9 t4 N9 @- U: C( J3 l; v
tbl = AddRow(tbl, vItem, "...")
1 I/ W" l* {) x# ]5 d4 } end if * j1 N* a& x3 }& u5 q6 t# Q
end if
" a x9 `& M$ k$ Z$ m3 r end if 5 _ K4 E9 {, V: s- S! o3 g
Next
0 n' ^+ G- @, Z+ S+ ^ if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
0 r% ~' t4 l+ v) f+ r4 C9 z! a tbl = MakeTable(tbl) & r( f4 r: U4 N" v, `
if Collection.count <= 0 then DivSetNo =2 ! u4 W9 |; v% x7 p( |1 |; y
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ; D/ N0 ?8 I; x% z
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
$ J+ l& F. K+ l) S* ?- U Response.Write replace(tbl,"|", vbcrlf) / D3 m1 p5 J9 E( d& s' {: |0 i
End Sub 8 K/ m" C2 E1 M4 w* l$ K; Q
, N9 c( J; i1 l'*********************************************************** 5 \, b0 D* P- ^: \! s k$ s
'* AddRow
( `2 w% S, W/ \* L1 R'*********************************************************** , d. c) q% ?& a$ h _6 Q
Private Function AddRow(byval t, byval var, byval val) , I7 w* D* F5 L/ l6 v! a* B* X
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 3 J9 d- y% A1 _, Z
AddRow = t
/ ?3 C2 R5 {1 C- MEnd Function </P>< >'***********************************************************
6 p8 U; ?/ i' u5 S'* MakeTable
2 J: U3 a6 `" B p! q* ~'***********************************************************
' }$ L! H: P5 s0 V4 H+ sPrivate Function MakeTable(byval tdata) 9 M! h7 b7 H/ T1 A9 k
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 1 x+ _% q, X) A: P; H1 N
MakeTable = tdata
& y& P7 i; o3 d: J$ s4 mEnd Function </P>< >'*********************************************************** 6 c* B/ p& K3 r" l3 C
''@SDESCRIPTION: Draws the Debug-panel
; f- A3 f2 X- w N'*********************************************************** , s. x6 y P9 u5 A8 g
Public Sub draw()
' J, ?3 X5 S- {% m If dbg_Enabled Then
2 ~' g+ t6 g1 a dbg_FinishTime = Now()
/ g; j) Y/ q+ h) W# v4 ] 7 y$ P4 A4 ?$ Z5 m# ]" E
Dim DivSet, x 5 T; \9 T( C6 N, J6 v, K
DivSet = split(dbg_Show_default,",") % x- m$ l( `3 Z0 B5 w" z
dbg_Show = split(dbg_Show,",") 3 N$ r' C$ t+ ~. P. t: I# J2 c- R
+ G- q, q( P! Y/ a5 Z* }% Z. n. v
For x = 0 to ubound(dbg_Show) * n, a( O- t' Z$ ^9 l8 B+ z+ c% q
divSet(x) = dbg_Show(x) % D2 u5 W4 e) j; o
Next ( E0 I+ b8 X) ?6 ~5 J4 K
; a7 l( n/ p/ D5 N( X* k
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>"
" {, F2 G. z1 A. d: d+ W& g Call PrintSummaryInfo(divSet(0))
) t) f4 i H% {; ^ Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
0 i) A% Q/ {: Y6 F6 ^ Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") " t% K: k' ~, I6 y& d# N- m
Call PrintCollection("FORM", Request.Form(),divSet(3),"") 3 l$ G( O& i# u A/ D
Call PrintCookiesInfo(divSet(4)) 4 {; \7 U1 Z% j3 r9 ~
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))
7 b3 P1 t' o% R" c/ N1 Z+ V8 i Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
6 X" T( \6 H0 j* l7 f5 ] Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
6 \ q/ c2 C6 C Call PrintDatabaseInfo(divSet(8))
! J, S$ {& Y1 C4 B Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") * }7 x1 J1 |6 J1 i
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
% V. Z. M: A& t, j. g4 P Response.Write "</Table>"
4 e6 T2 w- ~1 x7 E8 U0 Z End If
5 G- U7 A! B* `1 A4 a) \End Sub </P>< >'Destructor 0 j5 `, g" s7 F5 G# Q% d( f" i
Private Sub Class_Terminate()
8 ]3 n" \# h2 t3 O3 O$ U* H e Set dbg_Data = Nothing
. Y, R2 {, k6 {1 x4 A' w+ KEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
8 d! ` X* m* a6 B$ SCLASS debuggingConsole & A) ~# ], ^4 Q7 t
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false : V1 f/ V ~5 l
&n6 N2 B) i8 O! ?% I
bsp;
4 t9 U/ K7 h. S0 }1 jProperty Get Enabled===[bool] Gets the "enabled" value 7 Q) m0 p* d( |2 ^" w
8 E- ~( J; a/ E7 I- n( ]% }
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
3 ?$ D O0 j& @
1 d8 E- d; s9 d% m$ wProperty Get Show===[string] Gets the debugging panel. + ]9 A7 j8 r N0 Q, o8 ?( f5 J
5 r& G- m) t$ J0 N' [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>< >--------------------------------------------------------------------------------
. P& x( Q6 I& s5 h# lPublic Methods </P>< >public sub===Print (label, output)
" ^7 q) d4 |2 ] Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) * ^8 ~8 L* X9 h/ `2 u' y
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
( J6 `7 v% a. l2 o+ a u Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- : u) `/ f5 j1 L$ F) b
Methods Detail
$ r6 n+ ~0 P, M7 s8 I6 m. B4 {
. E( c5 ~4 ?/ @public sub===Print (label, output)
7 T4 p0 r8 Y0 F v5 nParameters:
/ e' `5 q, ]' Z: u2 t - label [string]: Description of the variable 7 P2 X4 q. U9 T+ P7 V
- output [variable]: The variable itself # M+ z/ s2 M) @
. B! g+ @# C# i! E4 V
public sub===GrabDatabaseInfo (byval oSQLDB) & y. u4 ^* Q5 _+ C T: ^
Parameters:
, k( j, m" l6 k - oSQLDB [object]: connection-object</P> |
|