- 在线时间
- 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")) ! w! f D# E$ c, E2 q/ E; K
dbg_DB_Data = AddRow(dbg_DB_Data, "rovider",oSQLDB.Properties("rovider Name") & " Ver: " & oSQLDB.Properties("rovider Version")) 7 `2 v9 U& c g* u y! v+ ]
End Sub <>'***********************************************************
& P8 t* R$ c! b0 y6 c6 B$ T'* PrintDatabaseInfo
! `8 p1 ^# o; \7 S* Z'*********************************************************** q0 p4 t: g2 P
Private Sub PrintDatabaseInfo(byval DivSetNo)
' o6 ~2 M# x2 ?! i7 N3 p6 f6 l# G dim tbl
) z! i. K% R" L1 c9 d% L1 P H tbl = MakeTable(dbg_DB_Data) , |: Z" r, @6 [! R( n8 [2 D: s
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
8 y) m2 M/ @" r6 J5 D Response.Write replace(tbl,"|", vbcrlf)
4 ]7 v# z1 Y. p- S' d; fEnd Sub </P><>'*********************************************************** : X3 L6 z0 {7 w3 l3 ?
'* PrintCollection
% q0 t% y" B/ g5 E4 c1 {6 b'*********************************************************** 3 H& [, G2 S3 i# N8 V
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
' \% ]+ [/ `: s; O; \$ ^# ~1 b Dim vItem, tbl, Temp 7 U% Q0 w I& p" D& r* p$ O
For Each vItem In Collection
/ J8 q% B" i5 ?- {% ` if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
/ Q/ R2 Q" W& _" y, e) J tbl = AddRow(tbl, vItem, "{object}")
) B8 P) g$ @6 I0 l1 k elseif isnull(Collection(vItem)) then
1 T. T% R; A% t) o6 [7 j# U0 z( T2 U tbl = AddRow(tbl, vItem, "{null}")
3 n R8 _2 Z9 U7 V: T5 J' m' G elseif isarray(Collection(vItem)) then
* t: C( P3 |" Y5 P; X tbl = AddRow(tbl, vItem, "{array}") " [! j; i# Y& \$ `, G! ]) G
else 8 q3 l4 m( u# P3 ]2 L' ^
if dbg_AllVars then
; b$ K) e5 Q2 {5 U% ] tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
5 f1 O) W: |0 m" D elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then " E4 M @5 z8 l# x& u; B
if Collection(vItem) <> "" then v& D0 R3 p, w0 i7 @# I* e
tbl = AddRow(tbl, vItem, server.HTML6 @# M6 G0 h& j+ h0 W0 R$ i
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") * S' V; a/ M1 b; b9 }6 G+ X8 L% v
else ; f* p, F7 V& Y+ B8 {4 W4 t* n3 S
tbl = AddRow(tbl, vItem, "...") # K0 `8 J( ?$ c8 @ }1 n
end if 0 p- P( a' H. t# o
end if
5 g% j' E# R) L ` end if
7 d; x: l" n. ]3 ], X7 @; K Next
! G+ B" b. Y% x8 c, J if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 9 r$ n% W) [4 F0 V, x8 N
tbl = MakeTable(tbl)
! k; k+ b, d% U if Collection.count <= 0 then DivSetNo =2
7 b; e- v* p" b7 d+ e tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) : v- N- F" Y5 K$ C7 Z
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
' h6 N0 e; B( @' X6 x1 ? Response.Write replace(tbl,"|", vbcrlf)
! f* ^; S4 F; d6 Z9 _2 OEnd Sub
0 `+ w( Y4 A( W1 K. ~# T
/ |+ G+ V) H6 ~6 Z7 Q5 {1 N" w'***********************************************************
" R2 Z9 M6 E% g B; c'* AddRow
0 u5 Y5 Z: T. e8 b. Y) v'*********************************************************** : X) ^& w: r( J& h$ G; ?8 U! I; L
Private Function AddRow(byval t, byval var, byval val)
B) C! l1 b8 W5 }4 C t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
( q) g* ~$ W' ~) t" y AddRow = t
o4 T9 r$ G- y- EEnd Function </P><>'*********************************************************** % Z* k( |' N: w8 C" b8 c) n" ~/ }& o
'* MakeTable % i, ~ ]+ J* k* j1 u1 ~9 [* A
'*********************************************************** # g3 k) O, E0 F1 T, s% q" M( u
Private Function MakeTable(byval tdata)
) \/ w* D2 L G7 o+ W6 M tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" % _5 R0 a3 C7 u% H
MakeTable = tdata - z- l" F3 x7 d- Q$ B2 c( \
End Function </P><>'***********************************************************
' q7 j4 G4 P0 _2 f0 j4 x6 O" `8 g''@SDESCRIPTION: Draws the Debug-panel
& o' `/ ]3 h7 U9 }# {0 ]: b9 S' J'*********************************************************** / E9 L/ z& q% H% C% D" I9 {
Public Sub draw() 6 ]( l' _/ J+ i: l( h) F
If dbg_Enabled Then " x8 g" I3 ], X
dbg_FinishTime = Now() / {1 F+ h( y8 n
$ k* o% ^5 U* c Dim DivSet, x
4 _( a8 ?) a5 _# s DivSet = split(dbg_Show_default,",") / K& O2 V1 L7 \ `1 h3 F
dbg_Show = split(dbg_Show,",")
! _! x0 I) d: W- n2 c% u" S ' G, Y( D; i/ y: p
For x = 0 to ubound(dbg_Show) 1 w5 b0 u9 D+ x
divSet(x) = dbg_Show(x)
. ~3 u. T7 N; q' U% u! t) D& |5 @ Next
! @7 Y% x* R. j; w/ e! [9 H6 s
2 F; l8 _& k9 o9 ]9 J 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' Z3 Z0 E0 \ s5 c6 s$ w1 V
Call PrintSummaryInfo(divSet(0))
5 ?6 O! }; V) t* `2 m5 R2 q Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
4 n7 H4 j4 r8 q Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
3 e, M( \; I) M% [: Y. ~; B Call PrintCollection("FORM", Request.Form(),divSet(3),"") % S! R/ K9 Q4 C L+ H+ D7 o1 I+ p
Call PrintCookiesInfo(divSet(4))
1 k1 f9 U) a l0 B" O9 c 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)) ( |7 ]/ z9 `+ z4 c- K0 Q7 t# O
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
: f5 Z. K* O2 F0 |0 k' y5 G Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
& p# s5 o# v% M! y I Call PrintDatabaseInfo(divSet(8)) 4 O5 ^2 N5 J3 _- Q0 F1 B. y
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") 4 C/ n8 m+ X* r
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
" v, R/ ]0 E) B* V0 \ Response.Write "</Table>"
- r; i/ L/ R P$ A5 o1 _/ L: G7 ? End If * \& w3 V9 n* G. b0 N
End Sub </P><>'Destructor 9 V9 s! S K- k9 g$ O
Private Sub Class_Terminate() - I* z/ E/ g# ~2 Q% \8 y
Set dbg_Data = Nothing 4 c, B. I2 J+ u# e- C
End Sub </P><>End Class </P><>%> </P><>类的说明: </P><>( |! z( A: |# b) F. B- X4 Q
CLASS debuggingConsole
% n7 v+ N0 e* {& j* z; D# ~. DVersion: 1.2 </P><>-------------------------------------------------------------------------------- </P><>ublic Properties </P><>roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
5 b' T- j. O }4 v5 k3 X&n- F6 Z- M: e5 t' W# A# Q
bsp; 8 r# W8 O/ c/ T5 \ ]( w- @) n
Property Get Enabled===[bool] Gets the "enabled" value
7 P, }, {5 a5 l: M
6 y; K8 W5 o1 M( 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 9 s/ V1 M9 ~; E$ K: T
7 D. ` V3 w7 R( z9 }/ d: J0 `2 \
Property Get Show===[string] Gets the debugging panel. 0 o) @+ Q! f1 Y. ~8 @7 \) X; y
0 u) ]9 `5 ~% G7 kProperty 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><>-------------------------------------------------------------------------------- : S8 J1 X/ a( `7 N* B
Public Methods </P><>public sub===Print (label, output)
$ d' i7 t" k( E+ Z Adds a variable to the debug-informations. </P><>public sub===GrabDatabaseInfo (byval oSQLDB)
; A7 }- m8 W! y7 a* o* d Adds the Database-connection object to the debug-instance. To display Database-information </P><>public sub===draw () 7 N/ k. J6 G+ \, s9 p9 p0 y# i
Draws the Debug-panel </P><>-------------------------------------------------------------------------------- " g& `# n- |4 q+ N2 x3 i* i
Methods Detail
9 h% M9 ~3 q( R, i2 V7 j $ S' Y. ]; q: @5 M- c+ D* |7 L
public sub===Print (label, output) 3 i( r N, w3 Q2 Q2 C S% Q
Parameters: - \, [/ l: o+ p8 f& g
- label [string]: Description of the variable
; E+ V' N- w5 ~& K& c - output [variable]: The variable itself
) t5 O A; n! [4 y {7 a3 { L6 \
public sub===GrabDatabaseInfo (byval oSQLDB)
* }* [) X0 Z+ V5 ?, P+ N8 [Parameters:
* g' Z) ^* ^% @- ? - oSQLDB [object]: connection-object</P> |
|