- 在线时间
- 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"))
- q+ e/ W& [5 M) {# b1 J% ] dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) ( s W8 ?+ S% L7 h- U
End Sub < >'*********************************************************** " ~7 d( G' x h5 H5 r- P$ T$ i
'* PrintDatabaseInfo
5 }1 B! T, x- k+ Z5 }' q'***********************************************************
" h/ O+ H; H. k' o WPrivate Sub PrintDatabaseInfo(byval DivSetNo) 0 ~& e' e' v2 Z( P
dim tbl
' R, ^0 A- ?+ [# x9 r2 O tbl = MakeTable(dbg_DB_Data)
7 e7 L& Y% z; j tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 4 G8 Y4 u+ A9 R0 }4 L
Response.Write replace(tbl,"|", vbcrlf) 1 A: r1 i) Z) V9 A3 \! P1 Q
End Sub </P>< >'*********************************************************** 1 d7 E8 {% w4 f6 N1 [% e6 y9 Z
'* PrintCollection
* f1 G* [3 m' L8 V: p# t'*********************************************************** ) ^) S' @0 T" y, t# j6 o
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) 5 L, A$ D9 I% [: D
Dim vItem, tbl, Temp / Y. G, J( D$ G0 A
For Each vItem In Collection
" A1 w8 e: q, c: D- X" _ if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 6 a# g' S. u0 ?: d
tbl = AddRow(tbl, vItem, "{object}") # Y4 V, g. i2 p2 l. D0 N& }
elseif isnull(Collection(vItem)) then
' C5 I4 ], _6 Q4 t tbl = AddRow(tbl, vItem, "{null}") . I$ Y2 p1 r7 @. A$ s( R
elseif isarray(Collection(vItem)) then 5 Q: u3 m) j% d+ B- e2 f `
tbl = AddRow(tbl, vItem, "{array}")
. D$ l' A# Z y/ ?1 \% p else
L$ W. z' [/ ^( y% X! l if dbg_AllVars then / G, D @2 J6 P. P& L7 Y
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) " @. R D0 A6 d( [/ d
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then - D- _5 j/ [2 N
if Collection(vItem) <> "" then
- _; S* p3 c0 U9 q/ U tbl = AddRow(tbl, vItem, server.HTML0 u7 b) ?9 k% Q0 R0 [
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") ; S' W; i( L2 Z6 c U4 q
else
3 K$ N- V- D2 x. b% H, r6 a. O- q tbl = AddRow(tbl, vItem, "...")
! c j# \5 X& E' U" l2 I1 \6 \ end if : M4 \, u! I R/ @) m& s
end if ; E' S0 ~$ z) H2 k! c, ^
end if
8 @$ |& V% y% |$ v1 ?- U Next 4 q( g7 p- E; i) z: f) }# b7 e' `
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
$ b1 e" i3 ]$ f' h6 R5 a' d- t tbl = MakeTable(tbl) 7 b5 q1 |/ y! V9 X
if Collection.count <= 0 then DivSetNo =2 o4 a' K3 _7 J2 M+ I8 p- m% B
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
$ A/ e% c* z4 W& E4 p8 g tbl = replace(tbl,"#sectname#",replace(Name," ",""))
% P I, B; l" I$ E% P: T7 q Response.Write replace(tbl,"|", vbcrlf) 3 ] _/ S/ J- W) {
End Sub 7 k7 i4 g$ i6 Q, |
: B4 L! y! T( H'*********************************************************** $ @6 G8 y2 k: j
'* AddRow
/ M" k! @& S6 V'***********************************************************
6 }: y( R& |) Y) @1 d) ~& ?/ GPrivate Function AddRow(byval t, byval var, byval val)
& A: e( B* U+ g7 E6 U t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
; P. ^7 q' ?# @. u: ~$ T4 @ AddRow = t / Z3 ^ d! @5 j$ N' V, z
End Function </P>< >'***********************************************************
9 P- E' ]4 h; W' a4 o, T'* MakeTable
) M- K6 b5 y0 ]4 r4 f* S3 b% @'***********************************************************
# \, a8 b% a, p" t3 X/ QPrivate Function MakeTable(byval tdata) ! x% {1 z( a; P* ~
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" + A5 v, i0 d" A
MakeTable = tdata 2 R0 N3 N; o/ Z6 N5 g8 l
End Function </P>< >'***********************************************************
) U/ x6 Y4 ~9 t''@SDESCRIPTION: Draws the Debug-panel / T: g6 \: L; q; F9 }& J G* z
'***********************************************************
0 d' @" e& m; i8 B- dPublic Sub draw() ( q# v5 C& l- V/ N( `8 J. |/ N+ D
If dbg_Enabled Then 9 Y! Z7 r% Z3 W. r; P
dbg_FinishTime = Now() 8 o1 J x& C+ U. G: W: i
4 W- g3 V9 }9 B1 F% J Dim DivSet, x
' B. V' p8 k% R1 t* N6 h8 K DivSet = split(dbg_Show_default,",") 3 f1 h- P" g9 E
dbg_Show = split(dbg_Show,",") 5 X9 y5 o( S: r( W/ v2 ?
/ H' E5 p( F# V: k7 K
For x = 0 to ubound(dbg_Show) 7 ?$ ~7 n8 {. b, q0 o8 \- [
divSet(x) = dbg_Show(x) : U0 A& v3 T& E8 I8 y$ L$ p6 g* S
Next / g! Y( \- e! f3 C- L9 z: j
( J) u% T; b/ J8 i# O
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>"
' F8 ^) ]1 W4 D/ y Call PrintSummaryInfo(divSet(0))
' ~. M- w- R0 X+ j9 v9 @" x4 F Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
+ M3 \9 J" B: ?3 J: G Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
$ ~' ^7 C6 l8 V" m Call PrintCollection("FORM", Request.Form(),divSet(3),"") , \! r, L+ N# {6 u, p; |
Call PrintCookiesInfo(divSet(4)) - e( i6 y9 m* o1 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)) " k: C! q4 r3 G, x
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 3 X1 h; p( }) H) ?
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) + g5 [, |7 E+ a" m$ q& T: v2 t3 z
Call PrintDatabaseInfo(divSet(8)) 6 S8 Z0 ?/ y1 X& X8 T2 J( f9 x
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
` U6 C4 d R* d( o Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
/ v3 F8 `6 f, O6 ~ Response.Write "</Table>"
* n' N$ B8 ^) D0 }( f( R End If ( U" S7 P" P1 V D
End Sub </P>< >'Destructor
' \4 t0 l0 N$ I8 ~! Y& HPrivate Sub Class_Terminate()
7 `, U: c9 d0 P5 ]% Q Set dbg_Data = Nothing 3 M% Z9 ~2 f8 X" s( Q! d: E
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >' v0 \' \! D6 r! B# `: v* O
CLASS debuggingConsole * c9 F& L1 _ @0 A, w9 b8 B% r
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false " S N: n9 L7 k4 E% R3 U. r- O
&n
' A, P$ Y- t$ M+ F* n8 r3 U& fbsp; s; u5 |% b# B: X
Property Get Enabled===[bool] Gets the "enabled" value + O3 A* D" \( N3 [4 e8 _
# G* ?! A$ E. d- G' a" j @9 t
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 ( F$ i [: P. {+ o( h+ M
: N/ z8 l2 Z! @) r# |3 }( aProperty Get Show===[string] Gets the debugging panel. . g* G2 Y1 X. m0 M5 M' d# B2 }3 w
; p9 _$ z" K/ R+ \, a+ q
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>< >-------------------------------------------------------------------------------- 8 f2 |- _/ n# t+ v: r5 [/ w" M
Public Methods </P>< >public sub===Print (label, output)
- P# `5 [2 b6 P. T; V Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
2 H+ V- S/ R1 a) r! g7 E Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () $ j% y& N1 I {6 d; Y9 B( e
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 7 e/ Y) [9 v- K6 H# c
Methods Detail
% F3 F, h8 M4 d& }4 x1 U
$ W; M3 N7 ^% {$ t( k6 ypublic sub===Print (label, output) + P" B' y0 s3 T8 s Q3 v
Parameters: + m @+ W9 }7 a9 {
- label [string]: Description of the variable
9 r7 P2 X* `" n/ _9 }9 h( J' F - output [variable]: The variable itself
' \) I& j! t& ~4 b" d1 a/ M* n
3 ~/ }, Z" k8 D. o, P4 apublic sub===GrabDatabaseInfo (byval oSQLDB)
) k! j) U$ v+ hParameters:
! p7 \3 v y s1 {4 L7 w, P - oSQLDB [object]: connection-object</P> |
|