- 在线时间
- 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"))
! P. R3 [2 ~- B8 F dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
& C/ e+ b T, F, H- {8 SEnd Sub < >'*********************************************************** " K0 @9 d: u6 l0 V$ k( k$ V6 p& M
'* PrintDatabaseInfo
' I- [$ a+ @4 b- n0 J B2 C5 g'***********************************************************
! W* c9 |0 o! j8 ePrivate Sub PrintDatabaseInfo(byval DivSetNo)
! _* q9 ?; [4 I dim tbl 4 d4 U, ?8 D/ |( A y3 c% l3 u: x
tbl = MakeTable(dbg_DB_Data) % t! w& @/ X& k5 }
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ; `9 e0 x! t$ Y
Response.Write replace(tbl,"|", vbcrlf) 5 k) N5 ~' P( M$ S8 U. w. r0 l
End Sub </P>< >'*********************************************************** % k4 i: T* J+ |' A* R3 C$ Q9 X5 v
'* PrintCollection
2 g# f: q, e9 o2 B'***********************************************************
5 C' t- Z% P; d) pPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 2 c: b" |& j' W7 F7 K9 M% `4 g
Dim vItem, tbl, Temp
2 | x. m, o0 y For Each vItem In Collection
9 B- v5 \2 q1 z z' D if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ( @ l5 L) x, P
tbl = AddRow(tbl, vItem, "{object}")
3 j; {4 i& Q5 K- A6 n elseif isnull(Collection(vItem)) then ! N$ ~8 a- h5 Q% {& E& Q9 ~
tbl = AddRow(tbl, vItem, "{null}")
1 A9 s' A! H* F7 ~" N1 z3 O/ N elseif isarray(Collection(vItem)) then
& h* J5 W1 @( r5 B' w+ J# c tbl = AddRow(tbl, vItem, "{array}")
. ]2 c4 A$ d* [* \; u else
6 Y: I$ m# [& ^ if dbg_AllVars then + q- x$ d6 V1 X; Y1 L ?% Z8 U
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 8 M+ K& ]- P+ Q* k9 g
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 4 M: S2 r/ o( q v( D. y$ p
if Collection(vItem) <> "" then
$ B5 e! P8 Y5 j, s; y5 _5 B tbl = AddRow(tbl, vItem, server.HTML f9 }* y6 A" V0 ~9 \" L
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
% S7 X& z; o2 L+ L2 h- C8 z1 i else
7 `6 F( C) J+ M- x; h" M6 G tbl = AddRow(tbl, vItem, "...")
( U$ u+ w: `5 z5 b u' d1 e end if
, v, F3 w, y5 ? end if " }3 d# k: E6 R# |7 b
end if
& g0 x# ]; L; ^, E$ A5 Z" \ Next
% H' u5 o# r" L3 s( p4 O: d if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo $ Q: N6 T7 l2 {! y# |1 Z: X2 T3 s
tbl = MakeTable(tbl) 3 z8 y0 v* F+ D. o% C4 p
if Collection.count <= 0 then DivSetNo =2 3 Q" E F0 z& C# A7 ?
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) & @' a1 X* ]6 ?# |9 I- V
tbl = replace(tbl,"#sectname#",replace(Name," ","")) * K. L2 w- ?! A* [
Response.Write replace(tbl,"|", vbcrlf) 9 n+ X5 `' @4 `* @2 Y
End Sub ! N. o& t; E3 [5 B" O; }$ W% S
b9 V0 Y4 u; u+ b
'***********************************************************
% [! Q+ n W# w% O2 O6 m'* AddRow
2 x" o6 d+ r U4 ~. \9 h3 q'*********************************************************** 8 Z& [) n- L+ g Y; b6 k9 I
Private Function AddRow(byval t, byval var, byval val)
! g# {& }0 @ U0 E5 J1 {: J" f t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
0 B/ C; b+ H1 e: y, ? AddRow = t 0 H0 a2 J9 T( K+ |
End Function </P>< >'*********************************************************** " S) }% p8 L( g& |0 J) E" B7 \
'* MakeTable
# a% E* D, T9 M. b% t w7 M+ H' y9 H'*********************************************************** " l' }; D5 q4 E- e- k X$ c
Private Function MakeTable(byval tdata) . Y1 O2 i8 b4 W, @3 ~# V
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 4 H0 Y$ ?' E, r8 S
MakeTable = tdata 4 p/ q" u/ z- l- L4 C" E X
End Function </P>< >'***********************************************************
X* s W1 v6 E5 I''@SDESCRIPTION: Draws the Debug-panel , b' |. b' N/ f2 x
'***********************************************************
% A0 R% Q& v0 zPublic Sub draw() 6 H' {0 J) g; F
If dbg_Enabled Then
2 ]5 d( @, t5 E dbg_FinishTime = Now()
& O. Z+ J; A8 w 0 O C& r9 v0 }( c1 h
Dim DivSet, x
) K( e% @% c$ O: h3 X$ Z+ n' v6 B DivSet = split(dbg_Show_default,",") 5 v7 } m! C, \& K2 U2 s5 W
dbg_Show = split(dbg_Show,",") ) k$ T. Z8 w& [8 R% n( _
( Y( v) i2 n/ F. r1 W! R For x = 0 to ubound(dbg_Show) ) Q H+ C; u3 I2 j0 g5 R
divSet(x) = dbg_Show(x)
* t4 h% ~0 R& c3 P | Next
5 D w1 c8 ^+ X0 I( i; k
5 Z* e6 F4 ~) S) l. m+ f0 h! B 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>" $ V8 F+ {2 ]" Q8 Y. a9 B( Y% q
Call PrintSummaryInfo(divSet(0))
; B$ N- P( j+ o6 ` Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ( ~0 m6 i S& P: F. `- m) `
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
, y9 T5 ]7 B/ P! ?5 B Call PrintCollection("FORM", Request.Form(),divSet(3),"") 3 z/ t$ W2 y/ a( c9 ]: ]0 Q
Call PrintCookiesInfo(divSet(4))
$ Q0 d+ ?. B. ?$ O: ~5 ] G K/ V' ~ 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 T. O5 G6 F/ L- ?3 u Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
( e1 t0 d% D2 Q' n5 J Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
3 c) n8 D# U( v Call PrintDatabaseInfo(divSet(8))
9 R- x4 \7 c4 [: q4 S Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
' o* R* z1 @2 K" q* c6 z4 s Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") / j! i. q( v8 l0 i0 ~
Response.Write "</Table>"
# K1 f* g& u$ I! F4 G" i1 r' U End If
) W4 @& z3 D' z* vEnd Sub </P>< >'Destructor
: x! N0 _8 r9 g8 V! p. hPrivate Sub Class_Terminate() : g3 Y- p4 G: X( G
Set dbg_Data = Nothing
+ r! g$ ^- G a: v$ h) y: lEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >2 ]+ Y6 d0 s1 l4 I0 M
CLASS debuggingConsole + R% k& Z2 s7 Q! n
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false # t+ Z* q9 G, X. G
&n
* x5 _0 K6 b. S6 pbsp; 4 j' S6 U, j+ q4 f4 J
Property Get Enabled===[bool] Gets the "enabled" value ' b% Y6 ~$ u* u/ _2 Q3 v# c& h! P
3 E) D8 O$ n/ |/ b: b4 @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 ' @: U; c& g$ K3 j
8 ~' r. d8 r3 C( D3 GProperty Get Show===[string] Gets the debugging panel.
5 F( t8 f: |( i9 ^- {8 l # _& d) G0 W, j0 n5 ]% 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>< >-------------------------------------------------------------------------------- 4 y( y1 b0 ], H4 g3 E# u0 x. d
Public Methods </P>< >public sub===Print (label, output) ) e# u4 a4 u- e4 ? ^
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) & A, s/ ^0 B' o& j8 H. {+ |; c; [
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
) w' r w* `/ {5 R Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
0 P3 D W# d% Y& M* r: k9 o4 d5 ~- YMethods Detail % J* O. L' G$ K0 C
. R- i7 e2 a4 d% g- I) o$ ?( d/ {2 {9 vpublic sub===Print (label, output) % b: z6 @# v6 p
Parameters:
% x8 \8 h V- W( `# T - label [string]: Description of the variable
8 x/ h6 v0 `3 P% j3 \ - output [variable]: The variable itself / w* t! E, z+ f2 V3 e2 T
/ i# r1 c1 O# S$ f: v8 X
public sub===GrabDatabaseInfo (byval oSQLDB) 7 G' @4 Z1 D0 T% K1 \" f: g
Parameters: ( B) J; A! J# |7 S3 [6 z" b
- oSQLDB [object]: connection-object</P> |
|