- 在线时间
- 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")) ) L( ^& [0 Q7 O V; H& |2 ]
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
3 f+ E, D ~4 [; Z6 j% eEnd Sub < >'*********************************************************** # z$ T& i- c5 ?4 n
'* PrintDatabaseInfo $ s" W; U+ D6 E2 K; T- d
'*********************************************************** ) g. i# C" c, P, o( G* r7 r8 _& n
Private Sub PrintDatabaseInfo(byval DivSetNo) : N+ B, ]: j% v7 e& W
dim tbl : k, t" H3 C* j+ [) y/ o
tbl = MakeTable(dbg_DB_Data)
/ ~3 V& H& X6 c1 c tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
# J0 q* {, |# a/ u Response.Write replace(tbl,"|", vbcrlf)
6 J5 I1 |1 J& o/ zEnd Sub </P>< >'*********************************************************** $ H+ ^9 g8 r0 |+ ^! h& U" \* O* z
'* PrintCollection
$ g+ O8 {( Y0 T'*********************************************************** e- G. B, g" h" n {6 G
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
8 J ]5 t( c8 |! F, S) | Dim vItem, tbl, Temp 3 O# _7 |- d1 p1 Q# {
For Each vItem In Collection
- a( x+ n% h3 B if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
' |3 G$ Z: w; o( E tbl = AddRow(tbl, vItem, "{object}")
5 g6 N7 J7 R ?* U, F0 `' Z elseif isnull(Collection(vItem)) then
9 d( v: z5 h; a7 Z( y9 ^, I tbl = AddRow(tbl, vItem, "{null}") 2 z& c- t+ p, e- G: f, @/ i
elseif isarray(Collection(vItem)) then 3 U9 t& {1 G) B) u1 Y$ U; W* [
tbl = AddRow(tbl, vItem, "{array}")
7 m# U% K8 P; S% V else / d$ f, S$ m/ U B+ t( Z
if dbg_AllVars then * j4 D5 y! U, l
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
+ E8 n! T$ ` [! y) Y6 M% g elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
+ W- @0 B8 n) |" P if Collection(vItem) <> "" then 7 k1 Q3 [; @6 H S& L! G, e
tbl = AddRow(tbl, vItem, server.HTML
8 G4 ]8 l: X5 f" X7 |" T3 HEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
5 p& I1 u9 f+ q. n! b6 ^ else
4 T/ _% G0 X. D, |* _4 z( `. d tbl = AddRow(tbl, vItem, "...") ; \% {& _: X1 k4 X4 K' h
end if
2 O9 K5 n- O$ [5 o# Q3 y$ M9 z end if
3 d7 ^0 x# x2 w4 F7 X end if
; Z) ~' e: I6 `% j Next
3 A& i- P5 g8 t/ l* a7 Z+ u8 c/ A if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
. f1 c" S' W" s, l8 M2 d tbl = MakeTable(tbl) - x" }$ b: R2 ?
if Collection.count <= 0 then DivSetNo =2 # h* _' G' `0 S
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
5 b9 P0 d3 [" ]2 }: |( U H: v tbl = replace(tbl,"#sectname#",replace(Name," ",""))
/ ~. N! [+ f! }& ]8 ?7 |4 D; j Response.Write replace(tbl,"|", vbcrlf) ! _/ Q! f# m C7 v! I
End Sub
4 L# }# L1 f- m8 F( O& L: L
+ A D* B% R0 d7 N$ J& s) z'***********************************************************
2 Q* p6 e6 h( b: r'* AddRow
! c$ b( F' f1 b O( `& W'*********************************************************** 5 `3 P* m: L, ~5 h' E
Private Function AddRow(byval t, byval var, byval val) $ A8 `! e* M; Q+ M/ t8 D
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
0 _( p2 {& k: t/ | AddRow = t
8 V0 ~. K R vEnd Function </P>< >'***********************************************************
0 S7 F+ m. o8 P! o% O/ g'* MakeTable
. {( r& J& X5 |: j5 F; _7 q/ c'*********************************************************** 7 w; l/ m( @, v0 l) g
Private Function MakeTable(byval tdata)
% B6 [& `- l! H. r( L) u tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
& q- H$ L8 t" R g1 |' {5 h MakeTable = tdata
1 ^; O: p) ?, L$ d1 tEnd Function </P>< >'*********************************************************** 8 F* k) r& K6 E; r& E8 s' H
''@SDESCRIPTION: Draws the Debug-panel
) o |) J4 x+ ?% L" R% i& B! A$ y j'*********************************************************** % h3 [9 s1 B0 a1 Y/ ?$ k/ P4 G" B4 E
Public Sub draw() . {! h4 K: c$ B$ B; l7 \
If dbg_Enabled Then # f y2 |. u& W0 T
dbg_FinishTime = Now()
( t Z4 x# R, K$ N2 M
+ c. t0 z+ {5 y1 r! D; }! }8 v, ~0 h1 V Dim DivSet, x 1 G* \" Z' D% w D
DivSet = split(dbg_Show_default,",") , V: k/ z/ E5 R7 S9 E9 ?" Y
dbg_Show = split(dbg_Show,",") * H: K' y. b1 Z" I8 f
' W" a3 o$ D! g3 L; A3 E) I For x = 0 to ubound(dbg_Show) " c' s5 X' h6 D2 D3 Z
divSet(x) = dbg_Show(x) / W% T9 h4 }5 P
Next
0 {- p5 z: c: U: b# j( W w" X: W& L& N* @9 {
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>"
& S! ]8 ?3 N- [: W( c$ o Call PrintSummaryInfo(divSet(0)) $ @- m) F7 p0 h; m# Z7 ^
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
1 e8 |, C5 F! }! E Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 7 F% ?0 M) ]- M! A
Call PrintCollection("FORM", Request.Form(),divSet(3),"") # l. }- }; T. b: |
Call PrintCookiesInfo(divSet(4))
& |* `1 ~4 L1 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))
& L3 _% Q: j# R* ]" O. j Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ! [; Q6 N0 T1 n: r9 w
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
1 L( Y! j6 H ? Call PrintDatabaseInfo(divSet(8)) ; i% s$ s: K1 e& u$ l" U v* G
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ! c6 b+ e5 i/ p( l2 p4 Q7 n" h
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
# _1 q! Z8 b, i& [4 t: I Response.Write "</Table>" - ^! `# z5 M3 i5 ]( T
End If
; X/ n) ^! E4 H: MEnd Sub </P>< >'Destructor
/ v K& r. ?6 @$ PPrivate Sub Class_Terminate()
2 c7 g. a- Q8 ]) }! o Set dbg_Data = Nothing
: ?/ d! S: ?- E( K) k- oEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
7 b3 q1 }, b2 v% S4 @CLASS debuggingConsole
4 ~8 q) g0 o* @2 {: L. q. IVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 Q: l. {4 u S0 Y5 ^& M. p0 ?. [&n% }( V! n" D0 f
bsp; " O1 h7 H. p- J- A+ \; t
Property Get Enabled===[bool] Gets the "enabled" value 0 T5 Z# D4 w3 h1 G1 C3 X1 i
( f4 B- j' v) X: O
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 ' D* s, e2 ^% N- r5 E
1 P& C# l, o t+ _* q' ^
Property Get Show===[string] Gets the debugging panel.
# D2 P9 t2 O, J1 ~! ` ' Q2 e8 I4 z" w) f5 ~
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>< >--------------------------------------------------------------------------------
/ F2 m! M- E y3 V( CPublic Methods </P>< >public sub===Print (label, output)
9 W% g2 p1 N6 i" N# [3 T Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
% {& @5 ?" P0 h0 K) g! i Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
+ f7 r# P) s- Z2 |5 v7 k! R Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 1 o' h- [+ B. ^% N: ?; t
Methods Detail
, O6 }3 ~2 p3 Z) r. z3 Z; f
) O, i, b5 A7 t; r/ Bpublic sub===Print (label, output) % |7 v0 l2 s- Y
Parameters: + |) Q* r5 e: U6 |) |, T
- label [string]: Description of the variable 9 v. x3 q4 W, z8 a
- output [variable]: The variable itself
& ?7 v% T7 }& {) q7 `
) }) r! g, o4 `, s# Opublic sub===GrabDatabaseInfo (byval oSQLDB)
! h* I, ~- k& [9 i. dParameters: 9 f9 b6 E! m0 U2 Y: P- C2 X/ p1 \' H
- oSQLDB [object]: connection-object</P> |
|