- 在线时间
- 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")) 8 N [5 F2 z6 S5 A
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
# t& x* o$ I+ h" i$ q8 R) x2 b6 SEnd Sub < >'***********************************************************
; M! [2 a$ @5 [: s3 J5 u'* PrintDatabaseInfo 1 V6 i- J- s* |# k: L* e
'*********************************************************** 6 U) t; C- J! w; L
Private Sub PrintDatabaseInfo(byval DivSetNo)
1 \% g1 ^# p( C1 V& x2 i dim tbl " c) ]: M0 v |. T! l/ K
tbl = MakeTable(dbg_DB_Data)
) \; ~; N2 t% l( @& j0 L3 V tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) * t2 k: U! }0 n0 p. U) A5 D
Response.Write replace(tbl,"|", vbcrlf)
4 h7 N1 w4 @# [& N! N3 Z8 d+ UEnd Sub </P>< >'***********************************************************
& r; ^7 ^. F( u; f1 I8 O; U6 W'* PrintCollection
+ d$ Z# Q: d3 Z. h+ d* }0 m'*********************************************************** 9 b1 Z5 ]/ g) b R4 m
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ; K: Z4 Q4 z& G
Dim vItem, tbl, Temp 2 q. G. a1 ?& o4 `" V5 `0 k: \
For Each vItem In Collection , S1 q; H" i& H7 v! i9 ?6 \7 D
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
3 _& b4 `, I, V7 V tbl = AddRow(tbl, vItem, "{object}")
& i- k i1 ^( c) [2 y elseif isnull(Collection(vItem)) then
2 t, r0 ?4 ?, v tbl = AddRow(tbl, vItem, "{null}") * ]( _0 s( F% J9 `
elseif isarray(Collection(vItem)) then
2 o# G' |; W7 G9 A* g" f tbl = AddRow(tbl, vItem, "{array}") ' C5 y( X- D8 t% a
else
( _/ }' L# p' r) O' v) k4 i if dbg_AllVars then
5 l! k/ H9 C6 m4 `4 A3 O- R tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
. O$ c7 `$ ^) y& E elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 2 E9 o: N2 S, r
if Collection(vItem) <> "" then
f4 c0 k( u$ P tbl = AddRow(tbl, vItem, server.HTML
W. M8 q& P$ e) ^# o8 _, uEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 6 u* ^- e: n& I( L. r6 F' d
else " C- {( |2 ]. }$ }$ P# O9 Q# ^
tbl = AddRow(tbl, vItem, "...")
8 `7 A4 L5 F) ^) K9 M0 ] end if # x& B& h( I u6 }4 E
end if
, V. F3 _( e0 b, q; x4 k0 e end if
" N6 D* e; v% e+ n, _ Next
* ~4 L0 K0 |' @5 v: Z7 }6 s5 b if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo * t2 f" R) P* D4 f! K* @& L
tbl = MakeTable(tbl)
5 [) _! S3 W6 _" _ if Collection.count <= 0 then DivSetNo =2
$ Z. ?9 m; |1 O tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
: T e/ j- N1 J3 e: S5 ~! \1 x tbl = replace(tbl,"#sectname#",replace(Name," ",""))
* R0 n+ Z; U* ?; @, x, x( d y Response.Write replace(tbl,"|", vbcrlf)
! {' x; G ]. S {: d9 ?5 w4 qEnd Sub
6 w+ r% H& V/ o! l) u, q " U* s9 n7 d' H/ U! u) T
'*********************************************************** " |0 k1 E1 Y2 A: j; | n* {1 [
'* AddRow
1 O( u& t c8 ^. |- j'*********************************************************** ! b1 B7 Q- R' I" [9 K. P% [
Private Function AddRow(byval t, byval var, byval val) ' p' E' @. ?) s) Q" h0 P; ~5 x
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
1 h7 _3 \ `3 J* m: @/ n AddRow = t 5 g! \( u: w1 f' A* J$ k. m
End Function </P>< >'***********************************************************
5 n' N A# e/ g8 v* S'* MakeTable 2 N. B7 q7 \: f4 a
'***********************************************************
+ X, y- I: R! L4 ~+ I& {Private Function MakeTable(byval tdata) 0 ~3 e9 s$ g4 D4 v* C |
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
) @* `' M# n1 i/ m6 F MakeTable = tdata 1 r' Q2 s8 q) S- {
End Function </P>< >'***********************************************************
3 N1 ?/ z! p' r. n''@SDESCRIPTION: Draws the Debug-panel ) b# w; x( B+ o2 {$ @( ~- k
'***********************************************************
) O/ s8 o$ M. f, x$ WPublic Sub draw() : t7 {1 ?2 l( |
If dbg_Enabled Then
3 K" c0 l2 A! V4 J dbg_FinishTime = Now() , G7 T8 B7 k7 P( _1 x3 T, N, L
. m L' b. I* e9 V C- j2 Q, I+ S Dim DivSet, x
* z' b) b( t4 P8 I6 d4 Z DivSet = split(dbg_Show_default,",") 3 i, C, G% O2 k- I" [$ l
dbg_Show = split(dbg_Show,",")
1 `* L$ x. O% R
: }0 a& H; a' Y# g& P9 L For x = 0 to ubound(dbg_Show) 1 [8 @ c0 j2 K/ I
divSet(x) = dbg_Show(x) 3 k8 h) {. E8 a
Next - p8 S: u' n1 J" j! \0 x2 ^
0 }0 @5 @2 v+ ~$ @1 l" u7 D. a 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>"
9 c; {2 L/ ` l Call PrintSummaryInfo(divSet(0)) & a/ @* o8 V$ c1 ] S
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
l, H# k6 \/ a' ?3 ?/ n* _ Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
0 z; Y9 U9 _' X5 }4 x Call PrintCollection("FORM", Request.Form(),divSet(3),"") / i5 T. @# G& d
Call PrintCookiesInfo(divSet(4)) + f8 z) K( C, g% s
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 Z, \$ V* q0 d [! Z Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") . c! p1 j7 `& B. D
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
) Q0 _, C3 Q3 S7 y. P9 T Call PrintDatabaseInfo(divSet(8)) : |% N2 I1 D# r2 p1 C2 K4 `
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ' b! ?- V6 Z1 g+ p5 D% F2 Q, ^
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
. V/ w( t ]9 t9 s Response.Write "</Table>" 0 @+ A% O7 \ l+ w
End If
" D+ e1 F( f" E; v; J4 u" NEnd Sub </P>< >'Destructor ) r' f E2 O9 L: q# I& k: B1 @
Private Sub Class_Terminate() 2 e5 \$ o% x, q" }
Set dbg_Data = Nothing 7 m$ \9 s9 I# n% D3 }8 E @% Q& u
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >: O1 u: z) |5 V- d3 c- d( E3 M( o3 G8 ` Q
CLASS debuggingConsole
n; ~$ x! x) @ r0 Q6 ?0 D9 k$ ?Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
# a& l; w' }5 }&n* P& u9 l6 b$ r, S7 I& D
bsp;
' V, ^: q! S! Z4 LProperty Get Enabled===[bool] Gets the "enabled" value
0 h+ K+ v! k$ w7 X* O/ I' p" `
; q( f4 N. F5 d4 t6 p% tProperty 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
3 h4 ?" L: Y! [1 A) Z4 @8 x: Y% M / K( B( H2 k3 N( a
Property Get Show===[string] Gets the debugging panel. 2 k4 L8 \+ X' a& L3 ?$ C( L- X
( M( e2 h- |0 Y/ A& x* N
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>< >-------------------------------------------------------------------------------- 9 t) G9 d: P9 j% p2 j' b
Public Methods </P>< >public sub===Print (label, output)
+ f7 u$ H8 ~" f/ o. O, E Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
k3 p% w& ?/ m; ` t9 n( J" F Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
4 G+ G- L; v7 p% @! ` Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
* B. o2 E0 N4 [; x. ?! a% |- Y9 uMethods Detail ' S$ U# d- Q; w8 ]6 f5 x3 p% F
7 q+ |1 G) I: U& opublic sub===Print (label, output) 4 c/ p' l* }; d* q) ^
Parameters: 6 I" Q7 O, k; m% N
- label [string]: Description of the variable
( \; s# @% q% H7 |4 e3 _ - output [variable]: The variable itself & ?/ d% h% @# p2 S
/ F; L/ ]* u' c% f. T2 h. z" d
public sub===GrabDatabaseInfo (byval oSQLDB) ! w5 C) t0 O# n0 p9 k. B7 f" i; T
Parameters:
$ x- ~$ @$ ?% T A0 \% [ - oSQLDB [object]: connection-object</P> |
|