- 在线时间
- 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"))
7 u2 q' O U4 B& M/ [6 g6 K2 l* d dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
& _' o3 |9 U; \& K( B+ A0 vEnd Sub < >'***********************************************************
$ d' c" h/ k( x+ V& A9 @'* PrintDatabaseInfo q( p, ^8 x& Y. ^1 N4 v+ h3 P, w) R
'***********************************************************
4 n/ B9 _1 t8 m/ ?! K7 b8 XPrivate Sub PrintDatabaseInfo(byval DivSetNo)
5 y* ?9 b. h" ?9 B; Q0 M) b dim tbl ) A8 ~. v: o$ N- [+ n4 X
tbl = MakeTable(dbg_DB_Data) , A4 e- \& k$ Q
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) & ?+ e8 ?! F9 t
Response.Write replace(tbl,"|", vbcrlf) 2 q* A% U1 p2 Y6 F- a
End Sub </P>< >'***********************************************************
5 L( ~9 _4 @' C' {3 ?' s; x( {'* PrintCollection ' W4 Q A! J4 [# t/ E9 P
'*********************************************************** g$ c0 \! N/ f0 H' q
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ; V0 X/ `8 \, F- Z
Dim vItem, tbl, Temp # ?( g" Y/ l9 w6 o5 u1 D
For Each vItem In Collection
1 d' n4 Z! M [- Q7 R! C0 {: B! J' F# p if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
, ~# c& r# ]8 ? tbl = AddRow(tbl, vItem, "{object}") 5 X4 ]2 p% i2 ?6 O# ~/ M9 X3 ?2 ^
elseif isnull(Collection(vItem)) then
6 J$ V2 Y9 T7 X tbl = AddRow(tbl, vItem, "{null}")
6 y) [5 \& Y$ k$ s5 G, h elseif isarray(Collection(vItem)) then
1 l3 {9 Y; b" O* ^ tbl = AddRow(tbl, vItem, "{array}") 7 p' [& {' L* q' E, m; C1 c
else % J% h! J" u- M0 O
if dbg_AllVars then
* b/ g( c. C+ F% |& f tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) ' i6 N6 Z9 \, `% {- c# J0 |5 j
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
( J3 f/ C% z6 L& C1 X" O# j; h if Collection(vItem) <> "" then
2 h; ?! K* p5 t8 H% J+ t tbl = AddRow(tbl, vItem, server.HTML
" L0 z8 t+ K" QEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") - L, B( z t4 S- L
else 0 C3 n) t! B& t- _3 ~7 r5 c1 L
tbl = AddRow(tbl, vItem, "...")
5 y2 u$ L/ |, Q9 |* Y8 P5 v' X end if 3 [. @- f3 L7 u7 ?
end if
0 ~1 m: e# h5 c, Z; P end if ) b( v9 \( e0 w0 t% Q, J
Next / U8 K# }( v' X0 p4 k `$ M6 k
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 9 Z2 u! s! P8 [
tbl = MakeTable(tbl)
$ o) T! F9 O3 O3 C/ Q if Collection.count <= 0 then DivSetNo =2
0 G5 y, F/ ?; U. c tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
# {2 T& b, x4 u+ q tbl = replace(tbl,"#sectname#",replace(Name," ",""))
% u2 \- |( T. n M3 G Response.Write replace(tbl,"|", vbcrlf) 1 H7 O' k5 p' M# x. { S
End Sub 4 P6 o& A5 t( D' H( G4 O
+ V: x0 d1 }6 b: j |" Z) s
'***********************************************************
9 }. X8 y4 b' l2 a& o'* AddRow
$ g9 Q' m. t* V% H9 ~4 ?'***********************************************************
2 ]1 @# I. m ?8 _7 o# zPrivate Function AddRow(byval t, byval var, byval val) ! e$ x, K4 b1 S' R9 f+ h
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
x1 s8 T- J6 [2 o% V4 b AddRow = t ) u% y& o. L4 ]9 M5 @
End Function </P>< >'***********************************************************
E {) g# U g5 H! Y6 h'* MakeTable , [* \# O: S& [/ G
'***********************************************************
; ?" U/ n# }! w, f" pPrivate Function MakeTable(byval tdata) & h! ~" K/ s$ r0 Z7 Z
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
# p0 R" o% S5 X# |0 p( M MakeTable = tdata
6 q$ o. {% S1 i7 d, G: E4 KEnd Function </P>< >'*********************************************************** 0 f5 I( T% }* h' V( X# C0 N
''@SDESCRIPTION: Draws the Debug-panel
+ ?+ \ j7 i3 B' F) C'***********************************************************
2 ?; r& _# r, V5 d7 J/ V6 sPublic Sub draw()
" R- v5 c% |7 L$ n1 s! H4 Y If dbg_Enabled Then
( w. v5 H: S' R* Q& q dbg_FinishTime = Now()
+ F) I) ?4 [+ H2 ? i, ?8 P% \5 N+ E n ; l) X6 M5 T! B8 _5 A, ?" B
Dim DivSet, x
* l7 D9 `& r! m' X- |( E$ N+ J/ W DivSet = split(dbg_Show_default,",") 1 N. L6 k, M3 Y1 p9 Z
dbg_Show = split(dbg_Show,",") . s. E# ]$ d; E6 i2 \% Y
- g L8 l2 b' n For x = 0 to ubound(dbg_Show)
4 P5 X) s* H& ~( H divSet(x) = dbg_Show(x)
: q* D+ T0 E' M' g Next
3 ~* k+ @! m2 ^6 J ]) m0 ?# p
% o. c/ n) I6 }) M# i 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>" ' F1 E$ S! d# W6 Q
Call PrintSummaryInfo(divSet(0)) 2 \0 g$ O4 c& W$ @4 J; b3 ~, \
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* P7 ]+ C; O3 w& t P Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") ; H8 o& N/ |. y4 I0 j0 w/ c
Call PrintCollection("FORM", Request.Form(),divSet(3),"") + j0 {, r0 w; `# t8 N
Call PrintCookiesInfo(divSet(4))
# Z, O8 N4 o. V# ]) K% q 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))
2 w# n1 @6 ~$ I Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
" C {1 U+ A8 G& y& J Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ( a- P' W- N8 H$ I
Call PrintDatabaseInfo(divSet(8)) : d' M8 b: s- g0 Q/ h$ \
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
, y8 \ i& i7 T Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
9 S8 k' A( Y9 w% `! m Response.Write "</Table>"
1 Y- G1 O+ i c+ m5 f End If
6 u5 w$ L K# U% oEnd Sub </P>< >'Destructor
) B2 `9 R4 f' O$ Z, E) xPrivate Sub Class_Terminate()
$ u9 T# n; U# b. A Set dbg_Data = Nothing # q K3 d5 H: \! n
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
3 D, o8 p5 C3 \5 n/ j1 vCLASS debuggingConsole
* r8 }/ b. I) o/ s# kVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false $ u6 h* M. b2 `& e
&n! ~% j5 t" K+ m5 L1 J7 \
bsp;
. m/ c' b- Y, A. J2 u1 ?3 pProperty Get Enabled===[bool] Gets the "enabled" value
4 q6 A/ N% H) G/ T3 ?& U
% Z' o+ j/ N5 E2 V+ KProperty 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 1 R5 y+ C! R3 W2 m2 w6 m
" U9 o/ T9 b, V* C8 P R
Property Get Show===[string] Gets the debugging panel.
. V0 }# Y" _/ B. R- X% X, Y
% V2 b/ t/ l, cProperty 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: c2 I1 j/ ~6 g+ oPublic Methods </P>< >public sub===Print (label, output)
" @, U: n9 H) P4 ]1 r Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
6 k& G+ p. Q4 g5 T+ d" b Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
k" {! b8 s8 F, V Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- , s# _, ?' | ~) q2 J' v: L" t! e
Methods Detail
' O% J0 f- R+ n. @' Z2 k: S* Y : X6 w. V1 J5 a
public sub===Print (label, output)
+ i) `8 L" ~8 ]6 O iParameters:
3 u- \# Z0 n* ] - label [string]: Description of the variable 1 m. F/ ~0 Z7 M5 z9 ]$ A, y& M2 B2 N
- output [variable]: The variable itself
* O( N0 c6 k( @) v0 B
9 F. |: |' ?0 E, T) p- ^public sub===GrabDatabaseInfo (byval oSQLDB)
0 a' f3 n$ _! J- S& G0 w0 oParameters:
0 W5 b! Q P) m8 U5 t) j( C- N - oSQLDB [object]: connection-object</P> |
|