- 在线时间
- 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")) / H0 U7 q5 V* F5 R3 U4 a& M
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
0 T( f* z# f5 c; dEnd Sub < >'***********************************************************
: K0 x8 F; |. b'* PrintDatabaseInfo 5 y. Z a- ~6 |" {( V( P
'*********************************************************** 7 d3 ^3 }8 C. u3 S
Private Sub PrintDatabaseInfo(byval DivSetNo)
; S. r' m0 W! B& j dim tbl
# I% x1 _; {5 h7 T tbl = MakeTable(dbg_DB_Data) ) H/ Y, K: `0 w, n
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
0 N T& @9 \9 D2 W& M% ?7 z& O Response.Write replace(tbl,"|", vbcrlf)
1 a/ \8 N" ^# d! s+ m' j Q8 rEnd Sub </P>< >'***********************************************************
4 V, d' D0 h% L. M; a. k- Y3 }4 |'* PrintCollection * } e/ ]; e/ y7 c7 d: O6 Q/ I
'***********************************************************
8 j3 H' q1 }* }, yPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
2 V# C2 ?' j0 O3 X Dim vItem, tbl, Temp
; w2 _) D3 Y+ x( v, U For Each vItem In Collection 3 r( F `/ V) J
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 7 i; m$ `6 ^; ~. N8 K. S
tbl = AddRow(tbl, vItem, "{object}")
+ Q$ z4 {! S: r8 r! } elseif isnull(Collection(vItem)) then 8 L9 E+ v( L F/ ~( c! D8 [# c
tbl = AddRow(tbl, vItem, "{null}")
0 R4 K2 t+ ~- e. \0 U2 ?% D4 Z" J) w0 U elseif isarray(Collection(vItem)) then
3 f- K' O, x6 o% w4 h: }# z tbl = AddRow(tbl, vItem, "{array}") 6 J: v1 e, N- O6 \ H
else
, c7 E+ \# H0 X. \# D0 M, _ N( B7 a if dbg_AllVars then
4 J0 w/ r4 B; s7 X tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
% i f* R- c9 d( C elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
3 ^+ r2 G4 O/ N if Collection(vItem) <> "" then
! x0 K( k# S+ G tbl = AddRow(tbl, vItem, server.HTML5 M+ g5 U) j* d! h
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
9 c+ L/ ^9 K, t. c' r2 N else & a/ y/ q3 g6 W# t, ^
tbl = AddRow(tbl, vItem, "...") # n- o. s ]% h% F$ u6 R Z
end if & t) f. k* q( U2 I! B, b6 u
end if
. m: y2 j; P7 N" y end if 8 ]( p/ Q) n9 F: S- I( G* w
Next , c/ ~: @2 W2 g! V5 O I0 f5 P* u
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
1 l* z3 j' b& v tbl = MakeTable(tbl) . w+ l8 a; c0 w+ R
if Collection.count <= 0 then DivSetNo =2 : C8 @. g* C5 _/ m
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
. M& [/ N; Y2 J" [" c7 F3 [, p tbl = replace(tbl,"#sectname#",replace(Name," ",""))
2 c* T, k! ^& x4 w* Y7 y* Q* c, [ Response.Write replace(tbl,"|", vbcrlf)
0 T7 a# Y5 ?; q* HEnd Sub
& u7 K1 _3 r" X$ i4 a! Z
& |; U) f2 ?; @ G3 H$ F- e3 Q'*********************************************************** ! {& ^# A3 i3 ~
'* AddRow & {6 ^ A. F" n. U+ Q
'*********************************************************** c9 e: h2 }5 e
Private Function AddRow(byval t, byval var, byval val)
$ `5 _: |" n; {1 |) z$ K% |/ l t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
! J# E8 u6 c5 z6 x& S$ }9 Y9 ? i AddRow = t
9 h& e# X- _! i6 ]End Function </P>< >'*********************************************************** 1 l& x0 o4 F+ {5 H/ u
'* MakeTable
/ ~/ a4 j- X9 ^" ~" L# n'*********************************************************** . J7 `# X, n. o- N8 d
Private Function MakeTable(byval tdata) $ V) `$ z5 t" o# U- H; C, P
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" + r6 h) v( t! E8 ^3 u, r3 Y+ [$ V) _
MakeTable = tdata ! t! h/ m( s9 ]/ U2 F
End Function </P>< >'***********************************************************
8 P) C+ Z7 z) u0 s9 h1 q''@SDESCRIPTION: Draws the Debug-panel 4 i/ v- U q9 Q# G/ e% |- Y
'*********************************************************** 1 ^5 g- W0 [' n+ z8 T! q; ^0 [
Public Sub draw() + z% p9 u+ p: ?
If dbg_Enabled Then , u3 r& T4 X+ ]( T
dbg_FinishTime = Now() 4 j+ c4 v, X. |
% e) F/ P0 R# y2 R6 J) t8 N: D% A
Dim DivSet, x
. U5 J' t5 G2 j9 C. w5 W8 q9 b' y1 R DivSet = split(dbg_Show_default,",") 9 g0 U8 L$ [9 l9 }. T' Q
dbg_Show = split(dbg_Show,",")
4 R$ G# |; |9 m7 A+ I4 |5 B
5 n2 T# W* \0 b! M* d For x = 0 to ubound(dbg_Show)
4 K% W5 i! `5 T; Y( r: v divSet(x) = dbg_Show(x)
8 p2 e+ f! A( g0 Q4 g y Next
0 w. _; @- p4 |5 |+ ~# _, e 7 l. v. ~% D' p; j4 r% s
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>"
`. a$ E' L) w Call PrintSummaryInfo(divSet(0))
' b; } h8 Z$ p) W2 D, @ Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
% w; B$ _; S( |3 p Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
/ x" s2 L( y) e5 h; ~ Call PrintCollection("FORM", Request.Form(),divSet(3),"") $ B6 i% g% q+ l, ~
Call PrintCookiesInfo(divSet(4)) ) H9 V- x c4 R$ }
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))
3 j$ f0 i+ y8 L, W' J0 B Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
' ~3 }* s( T, z8 T% V/ J% F* `+ a9 c Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
3 B+ x* j: }/ G4 H1 Z Call PrintDatabaseInfo(divSet(8)) 1 j& k3 M1 ]& C1 Q/ T5 x
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") + k; B& Z" l# z5 U3 k( Z* @1 `
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
6 d- F7 _- u+ H0 { R8 ] Response.Write "</Table>" % X+ v z5 B$ |; Y A5 J6 l2 y( e, Z
End If ) q4 ^' Q3 Z0 J* F' D0 F; z7 D
End Sub </P>< >'Destructor
) L* ?0 h7 |8 v1 `2 o' XPrivate Sub Class_Terminate()
# N3 O% R% N+ u4 k5 q* g' ] Set dbg_Data = Nothing 9 t" ~$ q& O: G# L$ b; V9 Y! V% M
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >$ c! T( |; B$ G
CLASS debuggingConsole 6 J: K' Q3 N( v! Z$ z, x7 q8 W
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false , R6 D- i- @% j! @+ `
&n7 F2 h. v U0 w7 V, b- E; b
bsp; & D: Z) a9 [# }7 {! L. |# I5 p
Property Get Enabled===[bool] Gets the "enabled" value # P+ z2 a, _8 ^' S p. l; D
- J7 b( C, X+ V$ w5 A4 i
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 9 g, G a% j$ ~+ I% V6 e
4 v8 D5 H1 l8 }2 [/ jProperty Get Show===[string] Gets the debugging panel.
, E( p+ W5 t9 W; c: @6 B; i: k
$ |7 ~% y2 v, S1 q) H$ C5 f- |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>< >-------------------------------------------------------------------------------- ) p5 o/ B" k3 }9 F# ~
Public Methods </P>< >public sub===Print (label, output) : O* D% S5 v' l% M) Z+ W! H, r7 g: q
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 7 o v6 q! B: D* n' v( K" [
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () ) ?7 y/ X( u) R$ W& n5 i/ K+ Y
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- 8 e8 c/ \0 R& q/ N @9 i4 `
Methods Detail
$ l: i) j" |# @' G" \) Q * C7 G4 t! M5 x6 ~$ w- A6 q4 j
public sub===Print (label, output)
6 m( O, V$ e- t' Y7 UParameters: / N2 N/ {: ?! v& }3 l, V5 u ~ G' j
- label [string]: Description of the variable 5 d$ T9 U7 P- `% m9 v- q
- output [variable]: The variable itself
; m, x/ f o |! y " l1 `1 h" h6 z7 n# p/ O
public sub===GrabDatabaseInfo (byval oSQLDB) # t* i7 K1 O; n* I$ r( ]% x& \
Parameters: ' @( e' F6 V9 U1 \" a9 J' a
- oSQLDB [object]: connection-object</P> |
|