- 在线时间
- 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"))
- a$ f3 W5 i9 O+ s" Z5 h dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) " s* ^: q4 {! a }5 _
End Sub < >'***********************************************************
) O$ E( ?/ }8 g- g6 J, t( X1 A% l'* PrintDatabaseInfo
5 l! _9 J" Z9 i0 p/ p. V" R+ j/ L& N'***********************************************************
( `' a- E* o8 {$ l$ j5 I- f8 ^4 pPrivate Sub PrintDatabaseInfo(byval DivSetNo) + x$ V1 A. m; S# ~
dim tbl ( L. _, b+ X8 p4 Y3 s+ C
tbl = MakeTable(dbg_DB_Data)
8 H0 ?3 r6 j a8 f5 e* u9 k, y tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) - j) z3 G5 X/ y. A8 Q, d5 h6 S
Response.Write replace(tbl,"|", vbcrlf)
% A2 B* A3 a4 iEnd Sub </P>< >'*********************************************************** - r c' _$ u# b7 V5 m# t2 [
'* PrintCollection
' ~: p2 [" n" z5 r9 L'*********************************************************** ( n: z6 R- R3 c- ^2 h+ `5 O7 s
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) ' n* Z3 v- F# ~0 r8 B! a4 f
Dim vItem, tbl, Temp
! J$ k6 l" [& Q9 C* l: x( W For Each vItem In Collection
$ t1 F) r! F7 s$ m7 S6 g% I if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
; r8 U6 A! n7 x) o5 Z' x tbl = AddRow(tbl, vItem, "{object}")
& { ?" d w. |% G0 c elseif isnull(Collection(vItem)) then 9 W4 P5 R) c# ]3 ]2 d4 f6 r
tbl = AddRow(tbl, vItem, "{null}")
. R) S& c0 i. y elseif isarray(Collection(vItem)) then ; p$ K' }/ i# o0 m0 O
tbl = AddRow(tbl, vItem, "{array}")
1 \3 B2 a) K* O7 T M5 w p else / |) L2 F4 K4 M
if dbg_AllVars then
' a: ~, m9 `6 L+ q# k tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 7 _( W+ j" B; ^. G( n
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then % l$ v& f+ C9 e, M3 |0 S
if Collection(vItem) <> "" then 9 `, Z) P! |' [$ ^4 ~) M) _. R; _
tbl = AddRow(tbl, vItem, server.HTML6 l; W7 ]' y( o7 u6 m! B& e; V
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
: X4 c( _0 d# M else
/ s7 n# |9 b; {7 z$ W1 w. Q tbl = AddRow(tbl, vItem, "...")
& y) D7 d% I% Z9 ~ end if
1 E/ m( p+ G' n8 }3 A5 p end if
! n8 M3 `2 a5 e8 E. e6 p( D end if ' [1 Y6 a6 J1 C! ^
Next
& ^8 B$ b% x8 } if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
0 g* e2 P$ A7 U tbl = MakeTable(tbl)
# p9 M: z2 m- K+ F( ? if Collection.count <= 0 then DivSetNo =2 : a1 t V- X! N* C
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) * u, t6 d+ z# s4 W8 e
tbl = replace(tbl,"#sectname#",replace(Name," ","")) 7 T7 K& e$ T$ J+ Z, k5 D" S4 i
Response.Write replace(tbl,"|", vbcrlf) % H7 _: h7 I( p- p
End Sub
9 A$ ]$ ^- b/ m. r. Y7 n) k" G
; C% D/ u$ Q8 X- r! @'*********************************************************** & `/ x4 m, x) w3 g
'* AddRow
6 j2 o7 w+ P! k& C3 p; I'*********************************************************** 3 A7 }* l Z1 u9 r) I/ L
Private Function AddRow(byval t, byval var, byval val) : R! I( Q, N( Q7 `& _: K) r8 e
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
7 M- e% E: s1 ~- C- T+ b; |& C AddRow = t
5 v% J/ t0 `: T5 J. ]End Function </P>< >'*********************************************************** , K7 a c; j% S$ H, p% r9 \
'* MakeTable
1 m$ y- W1 e* H# }1 t3 q'***********************************************************
; x6 l6 O( H% t+ DPrivate Function MakeTable(byval tdata)
' a2 Y+ N$ } \ D' E: Z* X% t w! Z tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" / u1 S* Q( d5 z0 ]
MakeTable = tdata
0 z d, L, S* G5 [ OEnd Function </P>< >'*********************************************************** , t8 h2 S8 C* ]
''@SDESCRIPTION: Draws the Debug-panel
8 l6 d8 v8 Q3 A1 L5 u6 \'***********************************************************
* _# \- M$ E6 ?6 g8 }5 FPublic Sub draw() $ N) _+ P0 T* a
If dbg_Enabled Then
3 J+ |+ N! \: F6 N/ t# G dbg_FinishTime = Now() & d5 n" z7 C- s+ n A( n! p4 ~
/ Z: T+ G! _0 X+ } Dim DivSet, x & @ x4 h {( x! ^ M* j* _) }, \7 k5 m
DivSet = split(dbg_Show_default,",")
/ z6 O( J7 i9 }6 F dbg_Show = split(dbg_Show,",")
' @3 W5 i7 Y; `& \+ G0 V 2 K. e; V* y2 K9 ^. }6 S3 I
For x = 0 to ubound(dbg_Show) 2 N% I5 T/ {6 o3 ?1 {/ w! d
divSet(x) = dbg_Show(x)
! Q* H- p2 D) ]' ~1 S Next
) j7 b0 [) ]& A8 A3 y. b% F' h! [7 I 6 w8 i: v1 b0 o) \$ _
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>" {0 @7 a% Z, D4 ?8 t. t
Call PrintSummaryInfo(divSet(0))
2 l- H9 b+ B7 q Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 4 Y1 s" f7 n& c- O2 J% ?9 s
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
0 X* J' B+ ?, G6 [ Call PrintCollection("FORM", Request.Form(),divSet(3),"")
1 a9 U+ q0 K/ E9 t9 n Call PrintCookiesInfo(divSet(4)) . y+ f- g- P2 A0 H+ {
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)) + d' M% `9 E+ H; G. L
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
/ V4 t! |9 r" O, e8 H) _ Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ]# S1 Q* p# }- q% ~! H
Call PrintDatabaseInfo(divSet(8)) 2 m0 E `7 R5 u3 m
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
! L/ z/ W, a9 a, Q Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") r1 v7 r" `% x6 _$ k
Response.Write "</Table>" , b+ L! q) c$ z8 k6 Q
End If 8 |: Q( m' r. A4 r+ j4 h! | f
End Sub </P>< >'Destructor : D: i6 M/ F! u. n
Private Sub Class_Terminate() * ]% ^" x" ?% [- x
Set dbg_Data = Nothing ! s( F6 R. H/ o# H) v2 f
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
% @% F7 G: R1 O0 H- yCLASS debuggingConsole ( v$ p( W7 ~: L( _! ~& _" @- A) ]
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
9 O+ e, U1 F% l' k R. X&n
+ ?+ G1 P: Z% w, Pbsp; % e7 C4 s/ }) Z* O& @% `5 o
Property Get Enabled===[bool] Gets the "enabled" value
' @0 V+ u. W5 m7 a2 ?, m) o/ e 8 G1 }5 n0 o5 z9 K$ I& x
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 / Y* i% h# R* z# q0 S( T7 U
8 O& s( `2 F$ r. @
Property Get Show===[string] Gets the debugging panel.
9 Q6 o; H* k5 s 4 J1 N# ^6 j% t( a; s$ ?, i
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>< >--------------------------------------------------------------------------------
. d+ n5 b$ v0 T/ OPublic Methods </P>< >public sub===Print (label, output)
, o. D/ U' @8 f Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
7 e4 s: q" R# f3 V% E4 c/ `& H Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
& q' U" @# E2 q% O' S: u. u5 N6 \ Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- ; I, p; \4 h/ q& |8 S* Q
Methods Detail , }6 w2 q% T# A5 a$ C. x& B
* J- S# H: a( b# D
public sub===Print (label, output) 1 Z- ?2 r: X5 w! P- V- [, B6 @
Parameters:
+ m% D' n5 f3 X; C4 M4 g7 P - label [string]: Description of the variable * P; Q/ Z5 T8 T; o' ?
- output [variable]: The variable itself
5 v7 d7 ?1 ?6 V7 N {% K" D, U ! O6 h/ h Z" K# h+ `
public sub===GrabDatabaseInfo (byval oSQLDB)
& k% @3 B2 }$ E' IParameters: 5 `. `2 p0 @! n# A6 E5 t% o
- oSQLDB [object]: connection-object</P> |
|