- 在线时间
- 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")) 1 v8 l n8 w7 @9 B9 |1 ?7 t& w3 q
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
2 r5 I' g* |- wEnd Sub < >'*********************************************************** 8 ~ D/ ~+ l9 g# y0 Z
'* PrintDatabaseInfo 0 z% S' Z8 A# \8 ]
'*********************************************************** : }: ]6 V0 v$ s' c, a. D
Private Sub PrintDatabaseInfo(byval DivSetNo) / y/ I/ G' i" [. F4 K- ~6 C
dim tbl
: B+ o$ v- R& C7 F( W tbl = MakeTable(dbg_DB_Data)
& T6 Z$ l3 P. s8 o tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) & Q) S; w" L* ~$ m: J Q( Y
Response.Write replace(tbl,"|", vbcrlf)
) q; j$ ^. f. j+ T; W# t4 BEnd Sub </P>< >'***********************************************************
+ ?6 L4 h* x1 `5 [# Q$ S'* PrintCollection ' K4 g$ @' @8 t, @! U. `" a
'***********************************************************
. Y, X/ d* h' tPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ! \. t, I, v/ ^* J6 @! v
Dim vItem, tbl, Temp
5 z$ f d& z% O" T For Each vItem In Collection
: `5 R. a; F- T* I if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then * S; o! H3 X* m6 W: ?( i3 s
tbl = AddRow(tbl, vItem, "{object}") , n2 g9 u9 m+ {- Z$ H- G5 w7 D/ s
elseif isnull(Collection(vItem)) then
% G, {. |3 `9 L) z7 ? tbl = AddRow(tbl, vItem, "{null}")
0 l \: a% z9 P4 { w+ _ elseif isarray(Collection(vItem)) then
2 E3 H1 w+ q9 I O; J tbl = AddRow(tbl, vItem, "{array}")
* [% J4 j6 K. U/ ]* q7 _1 s else 2 n( R# x6 K+ ^" m- G) |# k- x
if dbg_AllVars then
! J& W( q' b* Y tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
+ \2 Y0 ~# t; s; T/ q9 }; l elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 9 h0 \6 U2 v- _
if Collection(vItem) <> "" then 3 d8 g6 |8 K( Q, M7 F2 b, L8 |
tbl = AddRow(tbl, vItem, server.HTML
1 ]7 a! g- c4 G0 G: eEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") V9 V1 c! M# i. H
else
% g# Q Q. u. x3 Y/ G& N tbl = AddRow(tbl, vItem, "...")
* Z3 m1 u Y+ l& M* T; | end if 7 O( {. k+ |1 a# O5 n" q
end if
, j0 P# Q) {2 C# |; r" o2 G/ } end if
5 B; ]" E; X# k2 _ Next
) M1 ?- W( F% _* W8 x9 Y; \ if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
* H1 [4 c5 s8 Q8 |# a tbl = MakeTable(tbl) ) y- A/ I) N* G2 @0 Z
if Collection.count <= 0 then DivSetNo =2 4 A& M' b" s2 m' o
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
2 r& o8 l& x+ W tbl = replace(tbl,"#sectname#",replace(Name," ",""))
5 p; A. i: D" A* i Response.Write replace(tbl,"|", vbcrlf)
1 j+ r% M: W( x% I$ V0 K& T' xEnd Sub 6 u( V9 o6 Y; d3 Q( h
5 Y6 G! x7 L) k/ U: l; C'*********************************************************** , G# m8 _- z8 g8 y0 ]: [
'* AddRow
# Z: p9 R. t1 e+ Q2 q, Q* Z' a. N'***********************************************************
! c$ b$ x; a( g: T, KPrivate Function AddRow(byval t, byval var, byval val) ; B0 c, p+ x1 W# V) Q0 @
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
* K$ E8 b7 a- E! G8 Q: | AddRow = t
# h$ r$ `5 T0 ^& M% g6 T& B8 i; k3 Z7 rEnd Function </P>< >'*********************************************************** & Y; H+ n( s) f
'* MakeTable
" \' R% t8 f# k# r7 c O5 |; h5 s'*********************************************************** + D7 p4 K" G, e8 \! P4 _( I' @1 [
Private Function MakeTable(byval tdata) : c2 H/ L4 g+ L% L) c) ]" S0 b* u
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
: r" [/ Y' V9 `) W$ O. {4 G& z MakeTable = tdata
" K$ N, \( Q( ?& v' sEnd Function </P>< >'*********************************************************** $ }2 y6 N# |* o& O
''@SDESCRIPTION: Draws the Debug-panel
- H& b0 H. x' L3 a$ M4 V# H'*********************************************************** # O2 v% V! L% j
Public Sub draw()
/ M. x3 g) u6 s E! x; V If dbg_Enabled Then
$ a# p- R2 X( X dbg_FinishTime = Now() : L H( N2 e# ~' n6 _
9 x8 E: D! v- n: n+ G) \, y% M Dim DivSet, x 2 G- k7 b5 ]; S0 C$ ^1 D% n
DivSet = split(dbg_Show_default,",") # \7 m6 `( o4 z! L
dbg_Show = split(dbg_Show,",") 3 ~* r g* w/ h, ?- t, A8 s
* ~- p$ {* Z! S" m* d
For x = 0 to ubound(dbg_Show)
; k7 d* M4 B+ }/ ? [! l divSet(x) = dbg_Show(x) * Z' ^) U- W8 Y4 J* L- U3 J4 a# \7 y0 d
Next
- D% r' Q* o% J q: e, E : L" S: ?4 r- \: n8 U# A) 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>"
- l$ y3 m" f3 g Call PrintSummaryInfo(divSet(0)) # d5 w% X# U# X% R" {1 U
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 3 J# N; [8 _4 c @+ V! n5 Y
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 5 T, }! m# w6 Q# ]$ i
Call PrintCollection("FORM", Request.Form(),divSet(3),"") 7 v- P' o# \1 }( V
Call PrintCookiesInfo(divSet(4)) - c( V7 s g! @+ J9 P& N
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)) 5 R. k+ F. Z* m9 [9 f% H
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ) q5 q9 W+ c- q( ~( Q) v
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
$ q2 y# }2 w" q8 t5 v Call PrintDatabaseInfo(divSet(8))
, g1 i1 V& d& M* ]( x( x3 _ Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") % R9 {( |; b7 ]3 Z
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
3 s7 m9 y C* J# b+ u. F& H/ U0 q Response.Write "</Table>"
% q4 l: `7 _; k7 S- B End If 4 W/ O3 Q2 A4 c% e; V9 ~; r5 b5 V1 C) i
End Sub </P>< >'Destructor
4 `5 C# s D7 s7 w1 W4 hPrivate Sub Class_Terminate() ; k9 R5 Y$ m0 S: _
Set dbg_Data = Nothing
- p$ t# E4 g5 R9 mEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >6 U! M# ?$ s: \- m, e
CLASS debuggingConsole % e8 Z, B# f5 z
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
& j! G9 _3 a, V, t/ e2 y&n& o0 t" G+ O0 d
bsp; 6 E! S V5 G7 P1 I( m
Property Get Enabled===[bool] Gets the "enabled" value
* i) ]- k6 i0 b c9 d / T0 R/ O/ F) u r" {
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
$ d( G) ~# `. [ ?
3 f" Q$ \' g/ A( t7 l2 |- KProperty Get Show===[string] Gets the debugging panel.
* u- t, L1 k4 B
{% q5 L( _4 @, L2 uProperty 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>< >--------------------------------------------------------------------------------
, x) q7 m" z1 h% tPublic Methods </P>< >public sub===Print (label, output) $ S" Y1 ~. T7 C- f5 N7 c& A6 r
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) / U* a& x1 {- X- i; ^
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
+ a) {! ?5 P9 J! D Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- ; W k0 F4 r# @, M) H% p' U
Methods Detail * K+ \8 z/ \5 B% c9 y) r& B
% x0 \9 h( Q. @+ u4 \+ upublic sub===Print (label, output) * n2 R$ S2 W- h. {( C
Parameters: ! Q {0 ~" ]5 k- n4 c/ v
- label [string]: Description of the variable
/ B. e7 m* a5 G) m. L - output [variable]: The variable itself
# p! b. Y, b& @2 E( J4 ]2 n
: b; ]2 V/ ~! @3 @" X- Mpublic sub===GrabDatabaseInfo (byval oSQLDB)
4 i3 v- ^5 M! z6 t4 gParameters: 8 |# M8 |( l) Q( ?
- oSQLDB [object]: connection-object</P> |
|