- 在线时间
- 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 }5 P* n3 f8 }, h
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) & R. u# x' O/ x7 ]
End Sub < >'*********************************************************** 4 y9 \ n! [% I6 y, \
'* PrintDatabaseInfo
6 l3 O$ U4 h9 h2 [' A. f8 F$ m S'*********************************************************** ) M/ W' T. w( e1 \ [* x
Private Sub PrintDatabaseInfo(byval DivSetNo)
. F, k. j" {6 _3 f! Q m dim tbl * \# W5 U: [; q; w4 B/ e, ]# c! @
tbl = MakeTable(dbg_DB_Data) + }6 i/ y0 T3 m3 d
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 5 x9 H7 @. f8 m2 c
Response.Write replace(tbl,"|", vbcrlf) : S" i' Y. L7 z) ^1 d- R
End Sub </P>< >'*********************************************************** " P8 d$ s5 t& J( ~3 D. k0 w( ]
'* PrintCollection & S8 B4 z4 r0 h3 C2 S
'***********************************************************
" N3 T' ^1 s2 N. _Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) , V; y/ L9 I+ X3 v/ B/ C8 v1 q4 y1 m% L2 a
Dim vItem, tbl, Temp % S) b+ p+ ~0 m% a) @
For Each vItem In Collection 1 R, Q {8 T$ m5 n; z, }! ~; z
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 3 I0 ^6 s% Y) A; K4 m8 r. _( I+ s5 a
tbl = AddRow(tbl, vItem, "{object}") 6 z* l( f4 r0 V( i" j
elseif isnull(Collection(vItem)) then 2 } u$ {( p' o4 g6 b
tbl = AddRow(tbl, vItem, "{null}") . d8 A; g9 p4 n- z6 w
elseif isarray(Collection(vItem)) then / M2 g: K( g- ~) z7 u
tbl = AddRow(tbl, vItem, "{array}") - m0 a" b( Y2 p/ \
else 1 Q4 Z8 p; R$ U2 K' J$ W( a
if dbg_AllVars then ; L# K' d( d+ j6 {6 w$ N, f ?
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) : }! R% j2 X1 ?% S; j _8 L% k
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then % h! W8 x! _: M8 Z! c* S( u
if Collection(vItem) <> "" then
3 N$ m4 _3 R% p$ r$ C ~ tbl = AddRow(tbl, vItem, server.HTML7 f9 e* _3 _: H! W2 Z' l- E# G
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
' _1 i$ R! U2 Z8 K6 k9 L else 9 F* m7 z: [! I" `# U
tbl = AddRow(tbl, vItem, "...") / Y- F c+ x6 m' K3 n* b
end if
S, Z$ e% u8 e) t c end if 6 b' B/ R0 n6 S) o4 d7 }5 L# `
end if $ I, U" _4 Z- p- z4 a7 ^( W) T; y
Next - a8 q9 @% f4 V1 R1 q& n
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo , e: s1 J6 v# `: {- p
tbl = MakeTable(tbl) ; H% \. j& s# J' I
if Collection.count <= 0 then DivSetNo =2 & w5 k9 m1 h8 G; Q$ d4 T
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
E! o1 l2 t- a( g, R tbl = replace(tbl,"#sectname#",replace(Name," ",""))
* r) V0 w+ B3 N7 ]' Y( o Response.Write replace(tbl,"|", vbcrlf)
0 F2 f6 n$ l$ F0 l5 K, LEnd Sub 4 T: r$ u5 ]9 ~- Q
( a. ]2 q5 k: B'***********************************************************
- ~/ N l# Y9 s, C) w3 @'* AddRow / t5 x3 J& Y9 U# c ^# M
'*********************************************************** & n6 ]- C: d8 U. i; h, y
Private Function AddRow(byval t, byval var, byval val) 7 w4 I- B! U1 b1 J" p
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" 3 y4 E/ K0 y% @ `+ Z
AddRow = t " S0 w3 A4 B" d8 ~5 u# y
End Function </P>< >'*********************************************************** % @, k7 _3 Q; D- j1 Y, {$ s( P2 ]! T3 j
'* MakeTable
. W9 w" B1 J5 L) I/ n" \3 F2 B% E3 e# I'***********************************************************
) q, y2 G- L$ a! RPrivate Function MakeTable(byval tdata) : E5 v9 m! \0 F
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
$ Y8 a: s, Y/ z. ~" l' F MakeTable = tdata 1 M7 W* r- b5 X% F) s: k) H/ |' e* |
End Function </P>< >'*********************************************************** . G! v3 N" t3 Q' v$ h' c/ W
''@SDESCRIPTION: Draws the Debug-panel 2 t7 e9 c) \! a- l' N$ Y d
'*********************************************************** " W9 j& S$ N( V0 ^9 ^( C# B
Public Sub draw()
+ a. O/ P2 P; G3 f- d If dbg_Enabled Then
9 r% @' N1 k* ^: y6 L/ K5 Y( u, B dbg_FinishTime = Now() . j S; ?% O' G: o' O. p
% T4 C5 L* @: D* ^ Dim DivSet, x - y2 q r r1 `- O" O
DivSet = split(dbg_Show_default,",") + Q# ?7 @4 J& J6 b; k) X$ g
dbg_Show = split(dbg_Show,",") |) U* l S( N& [. L
6 P8 m' v" J2 q: t$ U9 c; L
For x = 0 to ubound(dbg_Show) 0 s6 {1 x. d n K" C# C6 [& M! n# n
divSet(x) = dbg_Show(x)
* y! X* j! }0 y9 P0 y' _* r9 e Next
: }" ^+ L6 [( Z" x$ b1 A: z( k
3 ?* y7 _& r- D9 \2 Y3 d; Z 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>"
$ f/ [* J4 [+ U# ~* J Call PrintSummaryInfo(divSet(0)) ( u8 b5 E {0 O* g' q4 q
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 7 u2 v1 E1 e6 r9 y
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
( O, t; @" T+ s8 y- f% N3 Q Call PrintCollection("FORM", Request.Form(),divSet(3),"") : F4 Q3 a7 r: m4 O r
Call PrintCookiesInfo(divSet(4))
' ?6 P6 h* K d9 t6 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))
& ?4 H c% [9 P3 C8 _' W8 _ Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") . ~% t1 m) b5 ^' c( u
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) + u) ?1 A5 G4 [: {$ }
Call PrintDatabaseInfo(divSet(8))
7 _# d% \' R# o Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ' Q' q3 r$ _ u7 ~4 \1 x2 r1 ?) H; r. e
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 0 S1 w- A/ P; O `' {. y
Response.Write "</Table>"
9 a( v, X) R. D2 s1 K, C End If : s( ?! Y( U9 d k- a: ^9 Q
End Sub </P>< >'Destructor
9 L! [9 S5 ` g4 C, jPrivate Sub Class_Terminate()
7 G( K$ }+ R4 P, P- h9 |+ n; U5 z Set dbg_Data = Nothing
' w% n }5 E" PEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
+ O5 W" C& _3 _- PCLASS debuggingConsole : J- g( I7 c1 j6 u. c9 O
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
( o2 R( l: Y! J0 p4 K- J+ O&n
3 O8 {5 a( r& x5 ^+ ~* z% d1 Hbsp;
L& ^1 p8 ^8 N5 v5 }Property Get Enabled===[bool] Gets the "enabled" value $ V! ]# s' s- x9 G8 S( x
' s/ O: [! y+ NProperty 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
+ M( b2 G& Q' p1 k6 l ' h2 r# D6 b" d# l1 s6 x
Property Get Show===[string] Gets the debugging panel. ' e- H/ Z! _, e% ?, ~8 A
7 P/ n9 i' W, N0 r" ?8 W) c2 |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>< >-------------------------------------------------------------------------------- # p7 z7 ^8 c, {+ N+ \. r
Public Methods </P>< >public sub===Print (label, output) f! b) Q# L8 K! w# ~
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
9 L, Q: q5 O1 H: f8 X Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () 7 M y1 ]; a+ ?9 P
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 4 I; N, {9 e" U. W& h4 A1 G
Methods Detail
; N3 X0 r/ o3 q- J b! P ! ]8 M9 A+ L7 n$ ~
public sub===Print (label, output)
- q0 F2 G3 D# g. J8 |% zParameters:
6 J0 B) [/ y" t! P5 V - label [string]: Description of the variable
) S* m. f9 w$ m* r - output [variable]: The variable itself
. S! N0 W8 K9 L {/ v ! F' q1 i1 L7 ~
public sub===GrabDatabaseInfo (byval oSQLDB)
2 E' V$ L' c' D8 _Parameters:
2 c2 [% f3 u R; A9 n - oSQLDB [object]: connection-object</P> |
|