- 在线时间
- 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"))
8 Y) C) u: X! K& A4 b7 T/ h dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) + `2 l- D5 c' Y1 K v J( e0 q
End Sub < >'***********************************************************
' ~8 Z3 M7 ?! t% y7 k7 ?$ R# O0 L'* PrintDatabaseInfo
: E) I8 a, ~. }- P d3 Y+ ~6 F'***********************************************************
1 _ M0 X [9 z: Z+ v! o/ W! [; { RPrivate Sub PrintDatabaseInfo(byval DivSetNo) 7 I; K0 F# M( s- i; N0 v
dim tbl + n1 l$ r. G" r& S+ s
tbl = MakeTable(dbg_DB_Data)
: }, w+ }+ u5 O! v tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) & f+ K) |3 D) Z4 V9 l3 b3 K
Response.Write replace(tbl,"|", vbcrlf) 4 D7 r0 k8 M- `' Y
End Sub </P>< >'*********************************************************** " d* K5 M* V E) Z5 L5 S
'* PrintCollection $ F- }% d) e- y- ~% x! g
'*********************************************************** 7 A& }7 z3 s' S) }) Y
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
& L3 r; A+ ~( L# ^+ G: V6 G9 S Dim vItem, tbl, Temp ) p0 [" D$ w$ R$ C
For Each vItem In Collection
( y! I' b$ g! `0 h1 s) U if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
3 L" G8 Q8 S% B$ Z0 [ tbl = AddRow(tbl, vItem, "{object}")
! Y6 {+ U( s3 \% |7 @0 |) U% [ elseif isnull(Collection(vItem)) then # O, N9 f ?% ]
tbl = AddRow(tbl, vItem, "{null}")
( l$ K5 }9 e( n" m" u, G. R" ^ elseif isarray(Collection(vItem)) then ! O b8 i9 W. k
tbl = AddRow(tbl, vItem, "{array}")
, G# d/ x' k r8 f7 q& d; k else 0 E) u# q2 v. Q/ c5 ^
if dbg_AllVars then 6 m1 ]! |& I( g" i0 b0 X
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
* b" P- Y* w2 n6 e9 z& o8 h elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
/ n+ j! Z$ ~) q; D( q. n2 E if Collection(vItem) <> "" then 8 _+ a2 f; `' y+ X4 _
tbl = AddRow(tbl, vItem, server.HTML' Q2 u1 g3 I% z5 s
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") # H( R8 B: O# P' t0 x/ Y: V. ?* S* }
else
$ n, Z+ \( Y4 I8 g6 O! ^ tbl = AddRow(tbl, vItem, "...")
0 I/ j" G# t, F& ?- R/ t( p end if 4 l: `5 P$ y: \7 e, Z) Q& v5 \
end if
S4 P, F+ J# r+ b" s end if
u5 u& W: M# b4 D5 f, C Next ; _$ a- e' c5 a& a! q8 b1 u
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
# K* m7 ~6 h9 [5 U) [5 D2 r tbl = MakeTable(tbl)
3 W, l+ w6 X: ?: s6 D8 m7 L2 H if Collection.count <= 0 then DivSetNo =2 ' B0 p9 P- g& B7 Q+ f2 e
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ~9 O* F% d4 K) S" j
tbl = replace(tbl,"#sectname#",replace(Name," ","")) + d' P& D* l: r& ~5 _2 E
Response.Write replace(tbl,"|", vbcrlf) + A8 l+ ^9 |, @9 Y
End Sub ! l# r" y5 `) @( P
- g8 ^3 ]8 h( C2 Z+ r7 w
'***********************************************************
" n2 k6 S, `% ?% J' \'* AddRow
) ~0 e5 N( F3 ^8 [3 _. a'***********************************************************
- x4 G. @0 @" A2 [# u. \' APrivate Function AddRow(byval t, byval var, byval val)
0 {2 F) Q# G" n4 z t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
4 a. m, l. L# k; {+ ~ AddRow = t
$ p; [- t1 i' I* {6 ^End Function </P>< >'*********************************************************** * f% G9 J/ v$ X8 G) a, l3 b% I
'* MakeTable + ^. V5 N, m5 c) b3 u* q
'***********************************************************
M) z" S* \3 ?5 ^2 G" g0 cPrivate Function MakeTable(byval tdata)
/ y- I9 ]: S' }% Y tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
. L) X+ h2 ]+ A! [4 W MakeTable = tdata $ Y2 i1 t2 u' I$ Z( e
End Function </P>< >'***********************************************************
3 n7 r5 ^: e/ e- m# X''@SDESCRIPTION: Draws the Debug-panel
8 B o2 ?" I, o' t3 b'***********************************************************
3 J) _5 l) G, UPublic Sub draw()
" g/ U7 v- q! T If dbg_Enabled Then
5 e! F# K9 d0 R$ q4 g7 A dbg_FinishTime = Now()
1 r$ o# w6 `% f 9 g" `/ @3 v; y+ Q, A6 R7 ?
Dim DivSet, x # k+ E( F% } A3 L' d4 r
DivSet = split(dbg_Show_default,",") 3 X; ?' ^; \2 w( K! ]2 d9 Q
dbg_Show = split(dbg_Show,",")
: c% R2 m4 O# g1 }. C5 t 9 a. h: E; I8 D# P q
For x = 0 to ubound(dbg_Show)
: \3 m8 ~0 w8 i- }, q" ]" E3 Q! x divSet(x) = dbg_Show(x) 5 \; B5 ~+ w# I* }2 P
Next
/ a( h+ W* ?1 b4 b2 t( C % z$ Z: B c7 V
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>"
7 O. S9 g0 e" W/ ]9 O9 D5 u Call PrintSummaryInfo(divSet(0)) 5 K; x7 n0 H5 V# j; Z- o* C
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") # J# n$ D5 b6 F' X
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") , K; E9 p1 c5 B1 M6 c
Call PrintCollection("FORM", Request.Form(),divSet(3),"") . l8 ]" r$ u$ h
Call PrintCookiesInfo(divSet(4))
& K+ L* e+ z1 U: X2 c8 Z 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)) p" S0 H; Y8 f" i, p/ A
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") , y$ Y' L+ U' M3 h! w1 l% ^
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
/ j5 J9 t4 q5 d; x Call PrintDatabaseInfo(divSet(8))
+ _$ r B) |+ E" I( T% I1 q Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") " O+ E$ M s, ^$ Y: t$ Z2 b5 N
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 2 x2 y; h! J3 J8 U2 \8 t& ?3 ~3 k
Response.Write "</Table>"
- E0 i. i% L) F2 w% E End If 7 ^, f& d$ I% n3 B+ l
End Sub </P>< >'Destructor & b: B, f% A- _+ R; k; X: P
Private Sub Class_Terminate()
4 e1 w V- ~5 T M. o2 B Set dbg_Data = Nothing
# E5 ]) Q9 A% L4 |. tEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
- [* W- U7 q' J# _* iCLASS debuggingConsole a2 D9 V; n9 } T1 k
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false . y7 T, o" j3 `0 g: i# J% t
&n, v" o+ } }& c0 U, G0 ^
bsp;
3 m) ]# c/ h% [Property Get Enabled===[bool] Gets the "enabled" value
4 u( E8 f. u, \/ M; f$ Z 8 W% F6 c( T7 W5 s8 q* z
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
' h; r' `0 l8 {# y* G6 m% O
. O* z5 d: }0 q: `- [6 h( E" e- K4 FProperty Get Show===[string] Gets the debugging panel.
/ G" a% P4 l. m4 `5 s3 f
. }$ q0 E- d. C2 X1 N: R& yProperty 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 u" Z- W: r4 J/ ?Public Methods </P>< >public sub===Print (label, output) . @5 U( c9 o+ k8 ` G: @4 j! z; e. `
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) F& u$ X X/ g0 } O& t
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
) _. ^# ~3 y2 ~8 R v Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
; P/ w! V. H6 o( W& L5 D$ {, w. YMethods Detail
% p$ J3 z. |) S' E 9 [1 G1 F; l2 F9 t
public sub===Print (label, output)
$ P3 V* j( k# P8 EParameters:
3 n( o7 ]# K# r8 {2 ~' | - label [string]: Description of the variable - t& a' k& V# d7 H/ s$ o6 n
- output [variable]: The variable itself 9 I7 J4 Q% T. f) Z" a7 u& n0 h* o& J
: P5 G" p2 `/ ~public sub===GrabDatabaseInfo (byval oSQLDB)
D) C+ w3 N* J+ b. vParameters:
& M. f- T/ c" U/ R6 e0 J- C - oSQLDB [object]: connection-object</P> |
|