- 在线时间
- 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")) # B, V: Y( W S, y, M
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) & Z% R, h/ ]$ v J4 p [
End Sub < >'***********************************************************
8 H+ |* N6 d% C) @( n6 |'* PrintDatabaseInfo
0 ~/ Z% d8 i S' ^'***********************************************************
3 H* S' ~! R& {, d& [Private Sub PrintDatabaseInfo(byval DivSetNo) 0 g7 _5 f0 u ]% C' l
dim tbl
4 \% R9 S' \! x+ C tbl = MakeTable(dbg_DB_Data)
+ F- z) c# p/ k4 N* q tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 0 l0 z: G5 Y: i w* @
Response.Write replace(tbl,"|", vbcrlf)
- [# Y) n5 c1 ]$ S+ g, _End Sub </P>< >'*********************************************************** ) g6 Y8 H% h; R5 x0 s0 o( L C
'* PrintCollection & }4 ?6 T' Z$ D9 X6 F
'***********************************************************
3 r& o0 H0 Q: H) @" b' n! y# YPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
* `$ T7 T$ W. P$ G8 [/ z Dim vItem, tbl, Temp * g( V1 F% o8 R+ z v
For Each vItem In Collection
6 k4 E9 M) B: L) [8 ` if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
5 w. _9 B0 s" j+ V. p3 \ tbl = AddRow(tbl, vItem, "{object}")
3 X' f) P2 Z% @% t5 h6 D elseif isnull(Collection(vItem)) then
# y$ g! g. C( \. b# D9 l5 D' |, A" f tbl = AddRow(tbl, vItem, "{null}") . x; A0 M) [$ C: r! T
elseif isarray(Collection(vItem)) then
! K6 h, c, G& t3 L# r0 o8 A$ P1 U tbl = AddRow(tbl, vItem, "{array}")
- x* n0 z! Q6 M4 R0 m4 R7 K else 9 g; P8 }* ?# I# G
if dbg_AllVars then 5 O2 u- N4 |/ C* c! g
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) * Y3 W! A" Q$ B9 v: S" i
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
, D; ]' s8 _# Y8 u0 O, Z0 E if Collection(vItem) <> "" then 1 ~3 c/ P) n5 b/ n
tbl = AddRow(tbl, vItem, server.HTML
( N2 m/ b# B1 S0 s1 }* tEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
" @( D, C' N0 o5 C+ A/ U else
" V- m% v5 a9 C" F9 Q- m tbl = AddRow(tbl, vItem, "...")
& w6 D; y/ y, \. |) t end if / I: b/ @& h( ] ^! O- t3 J
end if - Y/ o2 y) S8 _! w1 _5 k
end if
7 D" @$ X" @ [0 D: Y0 F Next
4 E) z' P4 c4 I$ R9 V1 o" J if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo & U, e) f- d' O: ~1 E d
tbl = MakeTable(tbl) 8 Z) q3 y$ o7 Y/ v9 ]
if Collection.count <= 0 then DivSetNo =2
: K/ J5 @% k+ u* V6 I* ^9 ^( s& F tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) 9 x6 k2 c1 g( t8 {- u( H
tbl = replace(tbl,"#sectname#",replace(Name," ","")) 9 r' h5 Y' b2 x$ q
Response.Write replace(tbl,"|", vbcrlf) $ y Z/ }# T6 l9 g: j
End Sub 4 @( x0 a" j! K9 _
3 o: M$ E N9 j( y'*********************************************************** ) o [; T' \. w) J
'* AddRow
1 K6 p2 m& L7 ~. T5 y'***********************************************************
: d; [0 _9 O" dPrivate Function AddRow(byval t, byval var, byval val) / I- [% ~- d# u1 _
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
2 Y% ~. B+ s/ i, d AddRow = t # e+ `7 b+ s& F, ]3 d
End Function </P>< >'*********************************************************** 1 h+ s. F" b8 [* v7 ~
'* MakeTable
, v+ G4 }6 {. P2 X, C( D; v'*********************************************************** 0 ]) Z8 P! p' _: }
Private Function MakeTable(byval tdata)
* R+ b5 B+ r& q+ N; H tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
' l# _- ? g, @# ~7 E6 T MakeTable = tdata
H7 \. a! c: x! q- @End Function </P>< >'*********************************************************** # d8 u: E7 I x3 Y& n
''@SDESCRIPTION: Draws the Debug-panel
3 ^' w$ o3 f4 @9 k _" i% P. m' V'*********************************************************** & N; D& V& d: [+ ^' z" r
Public Sub draw() - W' S# b) c$ F- e, i2 B @: @
If dbg_Enabled Then % l! }& E4 x1 \$ {+ X. @
dbg_FinishTime = Now()
$ N% C6 u( z M4 _; |/ l
4 q7 n# D# d, [3 }% _& g Dim DivSet, x
5 Q1 i7 L5 W6 ]4 e) N3 h DivSet = split(dbg_Show_default,",")
1 `; s% b& x) V' q dbg_Show = split(dbg_Show,",")
# g' P& k! o$ l6 x' @8 O
& l) V3 }4 v6 S- Z" Y For x = 0 to ubound(dbg_Show) ! c0 Q% M; Q! O
divSet(x) = dbg_Show(x)
5 u# X4 Z g5 P( W# i, a Next
/ Z2 `* {. s3 S+ }( B; }
0 m& z+ b9 C/ ? 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>"
4 I- c6 D) g4 ^/ X& S Call PrintSummaryInfo(divSet(0))
# \. s; [$ {! W Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
Z5 C7 i2 g( o0 l" | Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 5 e2 F7 K8 t& y1 t; C9 z9 r
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
0 T: `1 T- s' `3 a% {; v3 H/ E Call PrintCookiesInfo(divSet(4))
/ M& n* B- M8 Z3 _ 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)) # A. \) `. K2 q9 p
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
1 b1 `' m9 c2 u D Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) $ `' Y1 y( f" I9 G6 I o
Call PrintDatabaseInfo(divSet(8))
$ c, r6 D: \2 _" G8 V Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ; F% {5 v) E! F$ Z
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
, k5 N: n; z( E# f* Z3 o4 t Response.Write "</Table>"
& X6 h5 U1 @( X End If " u7 f1 |, [' r! J6 O9 ~
End Sub </P>< >'Destructor
# }5 }- K! Q; q7 XPrivate Sub Class_Terminate() 7 C K2 y5 d& v3 h
Set dbg_Data = Nothing - |, ?- @" h% ?2 A
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
* s8 n8 @+ [' J! I: `4 m* UCLASS debuggingConsole ; A8 C# H0 U ]
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
( p* w4 D9 S3 J&n2 W/ b3 u8 f8 y) Z: {' O$ W4 b
bsp; , s( R. X. T) B9 r& O$ A
Property Get Enabled===[bool] Gets the "enabled" value
# X' d% f6 y# Y& ]5 O( e 0 @7 Y! X2 ~* L
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
2 X1 H% ~6 S' F7 ^+ f
% ^- U8 {7 Q" BProperty Get Show===[string] Gets the debugging panel. / M* Z8 P, G% z+ H/ k: s% |" Z
; x7 ~- ^0 v" i; |3 W! r. W, E
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>< >--------------------------------------------------------------------------------
+ ~7 x) A1 C6 {0 b3 q5 |Public Methods </P>< >public sub===Print (label, output)
' r/ l) T8 h: _& S/ v. m0 ^% E/ F Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
+ u! t2 H1 Z1 R0 y2 \. m Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
& H: b3 _: Y! d6 i( u4 m, [* k Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- ( p0 _. d' c4 Q2 s- F
Methods Detail 9 B9 D% O# e7 ^, z m% ]9 {" U
2 l* p/ u" o+ u; ~; d
public sub===Print (label, output)
! I( s; L( l9 Z2 I/ JParameters: - v( S7 B; N! f, H: m9 C, \4 W2 G
- label [string]: Description of the variable / _# L) u2 E1 |. ~1 l; Z
- output [variable]: The variable itself
/ k7 }2 J3 V8 r0 Z . @8 v# }& d. s1 g. [
public sub===GrabDatabaseInfo (byval oSQLDB) - |$ s% f/ v" C( z/ _5 P
Parameters: 8 e" n$ t+ |: M! Z" S* T1 |6 q5 o
- oSQLDB [object]: connection-object</P> |
|