- 在线时间
- 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")) 9 T5 I; W' o' ?4 o. Z. {9 v6 e
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) & S# o- H; ~$ P
End Sub < >'***********************************************************
2 H/ b. L0 P: J% a3 F4 W'* PrintDatabaseInfo
, ]/ F' M' l* Y% o. C'***********************************************************
/ e' b Y( i9 E! c- h+ T9 kPrivate Sub PrintDatabaseInfo(byval DivSetNo)
5 R. z) S+ o# Q, a* v" { dim tbl
8 p; S" w: g+ \ tbl = MakeTable(dbg_DB_Data)
. u% E% W! P5 v5 _3 u tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
. U$ R+ m, z; Y7 g8 Q5 I1 { Response.Write replace(tbl,"|", vbcrlf)
6 t/ s: _( W; h5 c& r: x# pEnd Sub </P>< >'*********************************************************** 4 [ f4 d; @, |$ r8 G9 U
'* PrintCollection
% l% J7 t' t) F5 M'***********************************************************
8 Z! v. t; y8 T7 y4 S" JPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
* s8 k8 @- D! {1 E Dim vItem, tbl, Temp
- E5 Q& `/ ^6 T: D( f For Each vItem In Collection ) w' k) L( n% k0 F
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ; e" s7 F) z6 R- e/ {
tbl = AddRow(tbl, vItem, "{object}")
& y7 A1 [. p" \" C( z7 | elseif isnull(Collection(vItem)) then
5 z+ [/ B1 P8 @" l" Q S i% Q- c/ C tbl = AddRow(tbl, vItem, "{null}") : N! Q2 Z! ^& L: I
elseif isarray(Collection(vItem)) then
3 Y8 i. b+ V% Q: D! b; `2 k# u tbl = AddRow(tbl, vItem, "{array}") 4 [8 [* D- m! p. ~8 m. r
else
3 h9 k5 c$ n& Z if dbg_AllVars then
2 l8 W3 V$ x( w- | tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) ) s- b5 a: E+ J c3 ^! e3 \3 D' u
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then * S, z+ m$ w2 r% P7 Q
if Collection(vItem) <> "" then ) Z" L( l( a5 ^8 P# `: U
tbl = AddRow(tbl, vItem, server.HTML
" h0 R. v1 s& sEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
# c$ [- g T6 R7 G else 3 }3 @1 K, L) G2 {& x+ a
tbl = AddRow(tbl, vItem, "...")
2 |7 e) z- _8 V v" L7 R" | X end if ; S% w8 |$ s( l4 k
end if
+ d* o' Q" p4 v7 o7 u end if
f3 C- n9 A" }6 _2 K" |2 L Next / ^) t; \! ]5 W9 ?; f/ r
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo / n% r0 z& y) p# x; g7 a
tbl = MakeTable(tbl)
' |7 }5 {0 p0 h) e5 d if Collection.count <= 0 then DivSetNo =2
0 q. b) K4 ~+ g tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
w3 C' D, k* O( ^% p tbl = replace(tbl,"#sectname#",replace(Name," ",""))
& D7 Z9 M- |8 h: A$ r% T% T& p+ | Response.Write replace(tbl,"|", vbcrlf)
9 |) h- f+ A$ J4 QEnd Sub * }+ r/ c8 v7 @$ {7 m8 _- t% F
8 b( Q" M5 L: }# f" N
'***********************************************************
5 v ~$ n0 I- j j8 J6 C'* AddRow
/ V/ Y3 z) J3 O5 m'***********************************************************
+ x- |) F% g4 T9 q1 S& CPrivate Function AddRow(byval t, byval var, byval val)
& a' M+ ^2 I2 K- K t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 8 k5 b1 E: G* t; S3 _3 c+ P
AddRow = t : [$ j* x& F- X& X# q7 w8 u
End Function </P>< >'*********************************************************** % y7 M/ z$ R) m( g, j- k
'* MakeTable & ]4 j i7 p; ~* s* o
'*********************************************************** 0 k; E; N0 F- U5 `3 l* |) l! H3 J
Private Function MakeTable(byval tdata)
3 f" r5 b$ U' R! B5 D+ k tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
4 V- \8 M* l J" \ MakeTable = tdata $ L7 K+ y9 D X8 p& x8 U
End Function </P>< >'***********************************************************
' }" u8 l5 J8 o( ~2 C1 J# F4 f''@SDESCRIPTION: Draws the Debug-panel
) {6 _' E: w! K% V* w+ B6 c' q'*********************************************************** " C9 I5 K6 x- m* O) S: W% P; k
Public Sub draw() / r* W+ p2 |, z9 J5 z0 g
If dbg_Enabled Then 5 A+ u: O1 ~- Z4 f" q1 c/ j
dbg_FinishTime = Now() ) h- ^) q S7 l7 ]" L0 U
# ~6 ]4 ]% ]4 ~, @1 J i4 g Dim DivSet, x
2 I* F7 q' C- {2 r) e DivSet = split(dbg_Show_default,",")
1 ?+ l1 X3 G A m" M) V. p dbg_Show = split(dbg_Show,",") 3 L$ q2 `3 q2 m6 {
% M: _2 n3 J% Y( [0 o7 d8 {$ X2 ^ For x = 0 to ubound(dbg_Show)
& ?. ?. o( L( a2 ^5 p7 ] divSet(x) = dbg_Show(x)
! E7 m7 r7 W6 B, p, V Next
; x5 t, [2 J/ @! z0 S & ]/ P$ _* }& K7 D- m2 d3 M
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>"
* ~2 C5 |- ]3 ?4 a3 U Call PrintSummaryInfo(divSet(0))
3 H. y0 F0 j5 W7 V, s* T0 N) H, s Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
: K v' M, B4 T. o `8 }; x Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 3 G" J- U$ F& c% L& T9 e7 r
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 z6 X, t2 G. Z7 z7 a Call PrintCookiesInfo(divSet(4))
- K" x2 b. y' L 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 c x5 k2 [9 Y: P
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 6 o6 S8 `" z" W: `3 u
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
2 f$ g% k2 L& f3 d5 Q- D# e% ^ Call PrintDatabaseInfo(divSet(8)) 7 S9 z3 H" S1 \) [
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
0 V3 `- g: W2 S/ Q. n% W Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
7 L8 b( Y9 _& z: y$ A2 }: N Response.Write "</Table>"
; ]$ n5 `* D" J& C- e1 w9 x End If ! u, B/ |( u1 N. C6 a5 c2 ]7 R
End Sub </P>< >'Destructor / e; r4 e' Y) f0 S- |/ K# ~
Private Sub Class_Terminate() / U" P m6 Q# p) Q$ U& e
Set dbg_Data = Nothing $ B& I4 D4 g0 f, q' e4 r+ v; i
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >1 V+ O0 p! ^2 j+ U
CLASS debuggingConsole 3 s2 F8 U+ G5 E! e Y
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false - k* A i- _ {5 O0 L2 i
&n
, x) L a* u& [0 d: Y" d1 zbsp;
; s3 g; ]( H7 I- EProperty Get Enabled===[bool] Gets the "enabled" value & _$ `$ q- J6 z6 [' u; B+ ^
4 C$ K. y6 U9 p4 v6 q
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
" b% k" K- v5 l8 f
. T, n6 ^" T$ S$ xProperty Get Show===[string] Gets the debugging panel.
3 A6 {; _3 e1 B/ e 3 u4 J# ~( J, H' H
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>< >-------------------------------------------------------------------------------- 0 G: J+ j! n$ J9 ~
Public Methods </P>< >public sub===Print (label, output)
% e$ A, i6 s- Z c' U Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
6 w* Z4 I. R; o, S* G Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
8 q! g9 ]% A/ }2 H Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- ( `9 n1 S: z: c! d" q- U
Methods Detail 5 ?: O# H4 g7 I/ @* L
( K8 T/ V, H0 O( J0 R) I6 k! j- Jpublic sub===Print (label, output)
6 A( |( D# D6 DParameters: 3 h; ^5 z* c3 Q, z7 e
- label [string]: Description of the variable : A/ z- e' M3 ~
- output [variable]: The variable itself
, ]% s% r2 b7 J
. C3 r! A- d! _6 S4 m% opublic sub===GrabDatabaseInfo (byval oSQLDB) ! {6 Q; c0 n: B' Z. F& Q0 [- A
Parameters: ) X) T( ]+ `: [' K( @
- oSQLDB [object]: connection-object</P> |
|