- 在线时间
- 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")) ; L8 ?6 @ r' C; o
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) 0 y& ^: i* H- S/ [
End Sub < >'***********************************************************
- j/ b* m6 t9 [" l$ m9 q- G'* PrintDatabaseInfo 7 b; c( V5 p0 ]6 P9 e0 W/ h, w' J3 b
'*********************************************************** % G* P/ s4 M* J
Private Sub PrintDatabaseInfo(byval DivSetNo)
' g. A4 R4 r6 E1 M dim tbl
/ U E3 y9 D; }( b' ~& X tbl = MakeTable(dbg_DB_Data)
: T4 `6 T1 k5 s3 B; I1 Q tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) $ P5 @+ n- r$ C8 u9 ~8 E d
Response.Write replace(tbl,"|", vbcrlf) ; h1 e& ~6 A6 \- O2 t6 E
End Sub </P>< >'***********************************************************
# b P' c- G3 r'* PrintCollection
# i$ }0 K' ]& w1 o+ P'*********************************************************** 6 W) w% z( q1 A3 d5 g* O
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) + A2 @/ g: U8 P5 n/ G
Dim vItem, tbl, Temp
' o+ j2 w/ \% c7 X7 u9 b: F- z For Each vItem In Collection
& e1 ~5 N+ O$ z( P/ | \% [0 c if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ?' p' F) `/ X2 o7 w7 i9 l4 C1 k/ v
tbl = AddRow(tbl, vItem, "{object}")
# m j6 p' J& }- m, m' T elseif isnull(Collection(vItem)) then
; M, z1 O' f" L2 |( S( j* Y tbl = AddRow(tbl, vItem, "{null}") 1 p& t; F) H6 l8 c6 i6 u
elseif isarray(Collection(vItem)) then
2 I) b( g8 ]! C+ S: H tbl = AddRow(tbl, vItem, "{array}") % ^8 a, c' P5 M' G$ W$ @7 v k
else 2 u% o/ ~3 p7 S4 L* I
if dbg_AllVars then
o5 i6 S, E( \ tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 0 M! o) d3 x$ p7 e/ I; x
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
9 L! o. g# C B' ~ if Collection(vItem) <> "" then 8 ]8 k) t8 W/ z
tbl = AddRow(tbl, vItem, server.HTML
7 S* {/ L$ z. X. F' KEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
/ W; G2 P A# x* I" U( s else
/ l+ t1 x5 N) a# D0 y tbl = AddRow(tbl, vItem, "...") ' ^+ \, R- _( t$ l: H( v' ^& j
end if
9 j' p! E" F7 C8 `7 y end if ! D. s0 ? i/ L
end if ' I& |" {* m6 ]' ]* m: ?
Next
4 ?) Y Y& [, T; a! n) c if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo % D1 _1 X* P3 Q# V
tbl = MakeTable(tbl) 8 k1 F. A6 f& V8 n* ^7 N: D
if Collection.count <= 0 then DivSetNo =2
: G3 v3 {4 G0 I0 l: i tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
) O" g' [/ \' P p, n+ S tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ Q7 [( W0 z/ s Response.Write replace(tbl,"|", vbcrlf)
+ Q/ m3 v4 N& Z' z/ p" tEnd Sub
, Y8 M! Q6 d0 a. {3 E _9 \ - N7 g- p2 E% G
'***********************************************************
7 B3 ?% i3 C8 W4 M: @6 q'* AddRow
C3 J; Z* B! G5 B8 ~0 P( H'*********************************************************** * ^ T& O" _9 s: w9 u$ _
Private Function AddRow(byval t, byval var, byval val)
& l" l4 y+ Z) ?% e7 d* g+ N t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
" s* ]2 K: l+ L. M; H) c AddRow = t / j( Z. @7 p Q2 J! A& d
End Function </P>< >'*********************************************************** # p+ f8 n0 X# L# h: X
'* MakeTable
0 u T3 Z0 c5 l! v; }6 n* r$ x'***********************************************************
2 p0 b2 l) t; z7 xPrivate Function MakeTable(byval tdata) 2 f2 _1 C4 ]8 U* J- r
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" % e' d7 ]! O g! }- S5 \' q
MakeTable = tdata 0 ^, I' M) L& F. |! ~0 K3 k) N
End Function </P>< >'***********************************************************
2 G4 a+ y! n3 y' o" S* H3 }''@SDESCRIPTION: Draws the Debug-panel
0 b; E% T4 f* Y" V: Y'*********************************************************** , P! m! \) t" q! |3 I
Public Sub draw() , X( q0 V( H4 Z
If dbg_Enabled Then
9 o6 ]" y4 @ Y& V dbg_FinishTime = Now()
4 N. u8 P) z4 w4 |2 |8 E
( X% g9 @& m* ]$ ^* e Dim DivSet, x - i: e9 L6 b; d7 ]: ~! t% {5 v
DivSet = split(dbg_Show_default,",")
% N4 ~' D- s# R w: `+ c/ m dbg_Show = split(dbg_Show,",")
. D0 Z4 ]: [0 L# E; y5 O' {/ U! K5 j+ r
9 \0 L! s) ?2 T) `' p( ~: e For x = 0 to ubound(dbg_Show) + i8 l c1 E9 }2 H+ A; H9 j
divSet(x) = dbg_Show(x) . }8 u2 K- E9 Z1 v& N. J% I; A
Next 9 E* \2 b' {/ r" C
+ x# z H# W8 k1 b& G: p
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>" T* y% a( b. [1 _( c, f
Call PrintSummaryInfo(divSet(0))
/ U& Y4 I. d8 n5 |8 X- \4 w! q ~ Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
G6 O. Q2 T3 {% K5 f6 c9 Q Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 7 T/ L2 W. |# C; a2 f/ C! R1 @
Call PrintCollection("FORM", Request.Form(),divSet(3),"") / k# B3 T/ D+ y2 A7 H* B/ B
Call PrintCookiesInfo(divSet(4))
/ k" Q3 o/ T2 ~ 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 t) a4 R! ~6 U/ t+ @ Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
7 k5 k2 k, S5 h# S. X" e Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
# f. ^* h# J9 d( j Call PrintDatabaseInfo(divSet(8)) 5 R/ I) D2 f/ ]+ _; c& ]
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
6 I, u" z. h7 M* {% J+ f Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
" F1 t G! B! L# Z/ C Response.Write "</Table>" , w* l; {2 S+ R. H6 P
End If 1 `1 U; @. o! \) f
End Sub </P>< >'Destructor # i4 f7 n0 P# _4 x
Private Sub Class_Terminate()
' M4 R6 R) k! U6 d4 m5 O% \ Set dbg_Data = Nothing / P$ U3 A' n# ?& J; r
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >( l; @8 i3 H8 v' S3 ` {- A1 n6 c
CLASS debuggingConsole
* W$ o3 C8 W0 r; |, v1 S: m5 CVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
1 a- t" @& e- h&n
/ o; b9 t1 X1 w, i9 l4 x( _+ [bsp;
: v/ A; P& W+ e, s( {& Y8 dProperty Get Enabled===[bool] Gets the "enabled" value + ]- B6 Q2 U4 s
2 Y4 k8 W `1 C' 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
7 T) k' X v/ p0 V6 e3 N' \
) _0 H9 I8 L vProperty Get Show===[string] Gets the debugging panel. % ?% \+ {+ N! P
! p4 \4 q4 C8 F; nProperty 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>< >-------------------------------------------------------------------------------- ' ]! o( L, ~6 b9 _4 w# A
Public Methods </P>< >public sub===Print (label, output)
/ \) h" N2 h" w+ Z5 L; W X/ ~7 E0 Y Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
M+ p4 X1 h4 ^ b Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
& D F* w1 ~2 z& X' ]+ M Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
0 x D8 o: i; f6 F, H. ?Methods Detail # _: v! [2 E' l( v, I
9 C- f3 D1 D' O- Y$ A. Lpublic sub===Print (label, output) + Z" Q Z' x7 Y @' \7 w
Parameters:
" \6 B! p- W$ t" W- f- t$ K( f. W( O: Z - label [string]: Description of the variable
; }1 k* L A4 G5 V1 w& a2 O y' Q2 @ - output [variable]: The variable itself
+ U9 X& @" T( L; b) N
. s5 f \. }! Z# W, Tpublic sub===GrabDatabaseInfo (byval oSQLDB) y% [9 B. b; w0 k0 C: n: U: B# n
Parameters: - j! G8 V" ]& x
- oSQLDB [object]: connection-object</P> |
|