- 在线时间
- 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"))
( t; X8 \* v8 `. U6 Y6 X7 r! X dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) $ w9 Z5 \4 Y& t; k0 Y6 O8 o
End Sub < >'*********************************************************** + W$ _1 p3 ~9 w; L
'* PrintDatabaseInfo
, c& O0 I. r/ o'*********************************************************** 9 N3 O' I: Q8 o) b- g/ j$ f+ i4 n( B
Private Sub PrintDatabaseInfo(byval DivSetNo)
& O7 q! r: J3 o& E: G T. a dim tbl
, D0 D4 S) Y0 V+ \6 m1 h tbl = MakeTable(dbg_DB_Data) - M$ v( `' |8 [3 Z j- V5 x" s
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) $ t/ u/ i7 _0 Y- n9 A* D! U
Response.Write replace(tbl,"|", vbcrlf)
2 l- a. n) c7 z2 z* G% h$ |2 {8 AEnd Sub </P>< >'***********************************************************
3 o/ B" B3 h% h; l. o# @& ~'* PrintCollection ; s, m0 P" D% h& \5 c& M7 E3 o8 n
'***********************************************************
" A# Z; t. E8 UPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
0 H" K$ U, L* W" s; L! g& j# L Dim vItem, tbl, Temp 0 R" W7 e/ Q) z
For Each vItem In Collection ; a# l$ E' S4 }2 ?1 Y7 b, N: r
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then - T3 `/ U, ~) V) h* ?4 O5 Q8 Z. s$ `
tbl = AddRow(tbl, vItem, "{object}")
M7 m, M$ o* @! r# c elseif isnull(Collection(vItem)) then
( C7 h1 K# u6 g& z tbl = AddRow(tbl, vItem, "{null}") ) s7 @1 c( m- y" u% N+ y+ j
elseif isarray(Collection(vItem)) then
; N4 f& C7 ]& u6 Q, ]3 u tbl = AddRow(tbl, vItem, "{array}")
+ }8 Q! T' {/ Q else
# s' ~1 f* `# _: V% F if dbg_AllVars then # C% m( X' z8 ~( h7 e
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
0 n+ \4 O6 I/ X: ]% E# ^3 d elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
* N. p% S8 j2 W/ p9 q if Collection(vItem) <> "" then # B- v, O! C; q: Q, {& ]0 E
tbl = AddRow(tbl, vItem, server.HTML
: r, P6 P7 c& y+ X8 O$ yEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") " M$ i7 b* U( `! C. n
else
: s# l- w7 b$ N: M. | tbl = AddRow(tbl, vItem, "...") + M9 p- X5 W2 c" n/ Q" Q
end if
5 ?; v1 I$ ]3 x. y. `% a end if ! v1 c7 z' D; d @& e- l# N# N
end if ( f' C7 q$ Q' s% T7 i
Next " a# ^* J; d; j' O3 B4 C( {
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 1 |9 z( X1 u5 x$ Q% e$ H6 B- K
tbl = MakeTable(tbl) / I( T8 t k# m6 f
if Collection.count <= 0 then DivSetNo =2 7 {0 L7 a8 C+ y t- g8 U) [& X7 S
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
/ c+ g1 Z% w/ f tbl = replace(tbl,"#sectname#",replace(Name," ","")) : r" j* u' \ d. ^* M
Response.Write replace(tbl,"|", vbcrlf)
& g' @: V0 }+ T' _" W4 WEnd Sub " [- r7 M2 r; B) f
5 A- i& x/ g7 i. m'***********************************************************
|1 _. \2 d- j W4 b& K% n'* AddRow # ]; f% N0 ~7 t! r+ y! f1 n. P8 M
'*********************************************************** - a1 r+ g5 j! I! X7 R% [8 d" m2 d
Private Function AddRow(byval t, byval var, byval val) ; m' `, r/ _8 H) P* l% B
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 6 W. S# d9 V& n* d+ e; G" P
AddRow = t
2 z8 B9 w. {+ ^End Function </P>< >'*********************************************************** ) w# x" F+ N8 j8 W
'* MakeTable
, F4 J9 K& C6 B5 H. W'***********************************************************
2 M M' @, a1 t% S8 B, DPrivate Function MakeTable(byval tdata)
$ k L% t: @. @ F. U tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
1 N% q" r! I; ~4 X6 v MakeTable = tdata ( r* L3 W' p/ g$ t# F# z @
End Function </P>< >'*********************************************************** / X5 l8 x$ d; s1 @ p; r# @/ B
''@SDESCRIPTION: Draws the Debug-panel
" ^# A- _. Z8 X4 i'***********************************************************
$ }1 o3 k* j# e: a" R. NPublic Sub draw() 9 C6 G* K; ~* |* E
If dbg_Enabled Then 2 x/ }# }2 y( t3 O* z1 s1 w, w
dbg_FinishTime = Now() 6 H& G& {+ |) l, S' e0 @
) Y' r: O( o0 ]* v+ r Dim DivSet, x ; _( Y; o9 T, @$ r% |
DivSet = split(dbg_Show_default,",") ' g# G) K& g1 o) F: s
dbg_Show = split(dbg_Show,",") % m0 {+ k9 x; Z( O$ Y: e
) {& l" A% R& [( F- [
For x = 0 to ubound(dbg_Show) 2 U. y' W3 y4 C+ A! {
divSet(x) = dbg_Show(x)
4 O' i. J( a3 p& S' L Next
0 y7 v" i8 D/ s5 x. J 3 y, g+ f# \$ e! s0 n
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>"
- C L& P6 w; Z/ ~. h Call PrintSummaryInfo(divSet(0))
% ^ e$ F/ O/ I% m* b! K Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 9 u7 Z3 y$ T+ _ W1 {2 X" f1 A$ u% W
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") % _' N% U9 b# R! m
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 Q% I; c; U; \ g1 Z! U& a. | Call PrintCookiesInfo(divSet(4))
! U- |# m* j" c( B% K) [3 T 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 A: x$ m. E/ m2 ^* u; N Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") - L3 D) V5 z) P# A
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 2 q5 g* A/ I5 X8 p4 d% L
Call PrintDatabaseInfo(divSet(8)) - W0 K ^% o/ T- e, e/ K0 R0 Q
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
( r# s$ b6 c$ r: U+ R Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
5 j' Q' r; H+ y Response.Write "</Table>"
4 G' h0 Y% s! T8 _$ X l# T End If - j/ D, V% f) |: N
End Sub </P>< >'Destructor C6 f/ d! l; O m3 W( A t
Private Sub Class_Terminate() / I) ^8 f/ R8 \9 X( D; w
Set dbg_Data = Nothing * H" t6 G3 w2 R+ f
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >8 q3 |" U7 t$ t& S
CLASS debuggingConsole ; K, r: b8 W. F" m! v
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 8 Y5 `! i- U& s4 o* E9 ]
&n
; H, N% U+ ^. k7 e& Lbsp;
" o- m' U& T4 v, T1 r3 }& V& o8 vProperty Get Enabled===[bool] Gets the "enabled" value
; q$ F6 c% S6 w9 G2 V: c% L6 ~ j
) P5 j5 E& b0 }7 t# U LProperty 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 : g a G4 V! |& T. ~
0 v1 ~6 q, [7 q0 T1 V. hProperty Get Show===[string] Gets the debugging panel.
" |$ |, _; L! u" F " U* U- g6 |: d B$ 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>< >--------------------------------------------------------------------------------
* N* C' S8 c, K# J" r' \Public Methods </P>< >public sub===Print (label, output) 6 x/ q) L8 S8 D4 A6 r6 M# L
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
$ r. _* N! t) l/ {! X% ] Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
) _, c3 M. k- F Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- % J2 R5 n( ]" y6 O6 X
Methods Detail & E, B( X3 a H/ s: H/ _
$ q) A, |; |6 V. W) ^public sub===Print (label, output)
6 }& L$ X( [8 Y- u/ \3 Y/ yParameters: # L. {5 C1 _: h. A' M
- label [string]: Description of the variable & z3 f+ w5 l6 N( n) [) g' i
- output [variable]: The variable itself ; }& @# ]% n& O' h( s6 s; c
3 e- [% J; r* v6 @; `
public sub===GrabDatabaseInfo (byval oSQLDB) ; l) I% m% ~+ y# X1 A; T- `
Parameters: 0 ]) u" c1 F6 E- f& d% F0 f
- oSQLDB [object]: connection-object</P> |
|