- 在线时间
- 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% a( [9 ~' ?9 D+ H6 H' L0 g dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") & " Ver: " & oSQLDB.Properties("rovider Version")) ) n! @. g) {% _; X: s; T# N6 t
End Sub <>'***********************************************************
' J; O! ~( i7 c, c$ A% }'* PrintDatabaseInfo
2 H9 V0 N9 @! F2 P5 Q+ o' I( S7 C'***********************************************************
' z5 [. i8 ?. _3 B! n9 U7 PPrivate Sub PrintDatabaseInfo(byval DivSetNo)
) F0 Q5 ]& U: C% |) b) U. U) | dim tbl
2 O7 x, [& Y& ~7 M tbl = MakeTable(dbg_DB_Data) : @' j5 f9 \. ^2 h+ u6 K6 v0 X
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
0 l, R; f% o- ~' |3 Z Response.Write replace(tbl,"|", vbcrlf)
( z3 d$ O# S& R5 L5 Y) b: F2 ZEnd Sub </P><>'***********************************************************
! ^' F5 m8 m% w& N: }) F/ I'* PrintCollection $ S n% \+ g$ W3 A- [1 {! Q
'***********************************************************
. }* i- s* S6 ~: F7 p# r3 J' { uPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
& o5 v5 p6 o' Y Dim vItem, tbl, Temp
' M; F! p1 w8 e& l, A For Each vItem In Collection % T& i* w- a7 A( p% z% f; p/ a
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
0 D& |) m1 D. h5 k/ w9 c: a tbl = AddRow(tbl, vItem, "{object}") * Y0 G% s# R: Z. T+ u: E
elseif isnull(Collection(vItem)) then 4 m* M+ q1 W7 l9 V" u0 I
tbl = AddRow(tbl, vItem, "{null}") 1 {% Z3 b0 H+ H0 B. t5 Y+ l
elseif isarray(Collection(vItem)) then 3 X7 s4 g" s0 U" q. Y
tbl = AddRow(tbl, vItem, "{array}")
+ Q4 ?% |+ j9 J4 m" z0 C3 `5 `: I2 O else
q+ k& s/ [' G7 Y/ y7 F if dbg_AllVars then * o6 V2 d2 _; c6 t( V
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) ! Z9 d9 l; _7 ?3 O3 B6 o0 n- t
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 5 _% R0 ~9 I) k% J
if Collection(vItem) <> "" then
/ N2 e: Y7 D# q" Q' }5 F/ k7 e+ o tbl = AddRow(tbl, vItem, server.HTML- Y G4 U8 G8 F2 l
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") ; X! `, w6 l6 J* I& h
else
W: p2 E; a* ~1 v+ r2 } tbl = AddRow(tbl, vItem, "...") , U+ K, i- @, k' l
end if 5 y& V; t8 C w! _+ k. `/ J
end if . k$ S2 \+ w! R, ~/ E
end if
; b% }' r+ X) w4 m Next ; k; {- E. ~- L0 \# E! f; R" [
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo ( z; D/ W- k4 F1 B2 }, r+ }5 f2 p/ m
tbl = MakeTable(tbl)
5 ]( J7 K( ?" m# e1 B; N if Collection.count <= 0 then DivSetNo =2
- E0 W! @9 @* {6 w" A0 z. ^* W) U tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) # u" P. z5 Y% a3 U0 J2 ^: C
tbl = replace(tbl,"#sectname#",replace(Name," ","")) 0 e( ?$ a+ c! ~* E. z
Response.Write replace(tbl,"|", vbcrlf) 7 N( ?+ G: p d0 x: I
End Sub
9 G( t2 z* E/ w. }& z G O 1 x/ v/ ?& S T: X- h! B
'*********************************************************** " Y/ F# T; ? `3 u; ?
'* AddRow . C M& L4 N ^. L9 N# r4 M
'***********************************************************
9 H, ~6 w" c( _8 IPrivate Function AddRow(byval t, byval var, byval val) . U3 Q' }; m+ c/ r+ B( E
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" : x1 y }# d" p0 ^6 n: e$ v* n
AddRow = t ; J3 i; W- l/ S, f
End Function </P><>'*********************************************************** / L8 M- S- T+ Y
'* MakeTable , B% G8 G' j8 [
'*********************************************************** - ^! C4 e' q9 `- U/ r' \% ]
Private Function MakeTable(byval tdata)
0 ?* B: X5 J( ? ]* L, l tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
8 C) ^% W p9 y- E* t% A n MakeTable = tdata
/ i& z% [) I3 m' Y+ h! qEnd Function </P><>'***********************************************************
8 \4 x3 d$ S, t9 L4 t2 X4 T''@SDESCRIPTION: Draws the Debug-panel & ^# l; o* L+ t' F. r3 U4 p
'***********************************************************
& Z6 x) z2 ?0 F$ \5 { APublic Sub draw() 1 `- i% p5 U2 D5 N. P* k( \
If dbg_Enabled Then
9 _1 J" V! ] ~- T dbg_FinishTime = Now() 1 T* q" b5 C+ W0 ?$ C. o2 s
) V# ~) X5 i2 T& ]% R6 U
Dim DivSet, x
* E+ d9 j/ X, [0 L$ e' \ DivSet = split(dbg_Show_default,",")
1 C# M2 N) d1 X5 G3 B4 I dbg_Show = split(dbg_Show,",") & _5 A' H8 B& p
% f7 Z9 K) _1 m1 P( f2 J' H For x = 0 to ubound(dbg_Show) ; {+ L Z+ X _9 ^( T! y
divSet(x) = dbg_Show(x)
+ Q. E- Q3 z3 W% k* H6 y Next 8 L$ Y- a2 r; l9 D" ]
6 H! u# L7 g! P# U1 T 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>" / o# I v: G# V, x* `# F( C
Call PrintSummaryInfo(divSet(0))
/ b- r& t) p+ Q* a+ J$ v3 q Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") * t. i* i1 z% N" G& }
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
/ }$ x# @& g b7 c- e Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 O7 `; x4 o7 G% Q7 H$ k) A4 \ Call PrintCookiesInfo(divSet(4)) 5 P- n# L! P2 ?" H: l; e+ _
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))
% C( Y* [: ^3 D2 c Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ) t5 P/ e" h1 J% a7 p' V$ K% u# [
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
& Q4 Z1 S/ m" W) s Call PrintDatabaseInfo(divSet(8)) 3 e) c4 \- z" u: C$ j
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
- Q, X6 i$ r4 s0 i! E# B4 [* q: [ } Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
7 Z8 z/ ]) m, s9 Q Response.Write "</Table>" 4 I6 f1 S y& ~, ?: q0 h( }! b" [
End If ' }* D+ |2 T7 X# t) |% T
End Sub </P><>'Destructor ' c0 }: j1 R1 d- P
Private Sub Class_Terminate()
1 X1 b0 }, X2 m; J: V Set dbg_Data = Nothing $ R% ?5 z( O) p( Z5 n
End Sub </P><>End Class </P><>%> </P><>类的说明: </P><>
# n" A3 g6 L& @# r9 mCLASS debuggingConsole
* x5 s8 _6 f+ u2 |. ^9 I3 oVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false . Y" F; A$ c% M3 ^& V6 C
&n5 _) l5 v1 {5 T+ t4 q) `
bsp;
3 v8 c3 f, `; QProperty Get Enabled===[bool] Gets the "enabled" value
p' @& s4 J+ ~
/ ^$ U! g+ n9 n2 |2 gProperty 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
2 g3 y- U; \( e2 Y: M$ `8 K0 G( O) t 4 F) w. s8 n* X( c6 E
Property Get Show===[string] Gets the debugging panel.
$ M& Y1 U8 L9 k) o: i* U" \5 b 4 Z- p/ D0 T1 Q2 J' Q3 M
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><>-------------------------------------------------------------------------------- / ?% S0 u0 y+ G! O1 h8 [. M
Public Methods </P><>public sub===Print (label, output) : Y/ }3 h2 B+ \8 R
Adds a variable to the debug-informations. </P><>public sub===GrabDatabaseInfo (byval oSQLDB) / ?, V+ a0 {! ^7 C4 `3 ?
Adds the Database-connection object to the debug-instance. To display Database-information </P><>public sub===draw () + c8 b) ]0 H0 F |2 r8 g+ R2 Q
Draws the Debug-panel </P><>-------------------------------------------------------------------------------- " u7 s8 Z# K4 P! p/ U) w
Methods Detail
% l3 K( V5 `8 a" l
7 u2 U' a# V# d1 E o3 H E) ppublic sub===Print (label, output)
. |2 h* d% o: O2 O8 _& lParameters: 8 t [# q' a( D1 ^* I2 F6 G
- label [string]: Description of the variable
3 u* m) F7 ]' u$ J# c- u( w+ x0 E - output [variable]: The variable itself - H/ ~3 Q4 C+ ` d# Y
( i" E8 T+ ^7 r( v! H
public sub===GrabDatabaseInfo (byval oSQLDB)
4 T) r) L U3 u, q8 S6 E7 dParameters: # l7 E( }5 |3 L [+ n, J7 d) V
- oSQLDB [object]: connection-object</P> |
|