- 在线时间
- 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! O8 {# \; i0 \
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) - f- H+ V3 K% S" {' u/ @* u# r
End Sub < >'***********************************************************
2 `! M. K" ?" ^, H3 e2 ?# E" D4 p'* PrintDatabaseInfo
' m6 {; E3 b7 g2 _1 b D'*********************************************************** |: x' B8 }5 n; q! ]& O
Private Sub PrintDatabaseInfo(byval DivSetNo) . t6 Z& i3 N& V
dim tbl
4 W0 `) Z0 E/ x4 p% S' a- b3 \* e tbl = MakeTable(dbg_DB_Data)
( z6 B, m5 j) c9 c" |+ F# g' b tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
M' \8 G+ K1 a, G Response.Write replace(tbl,"|", vbcrlf)
% G" r/ ^' y2 N1 `5 n! y) ~End Sub </P>< >'*********************************************************** # F7 j; E, @ c
'* PrintCollection
* U1 `$ K) Q' M+ M2 E# H; q/ ?'***********************************************************
% ?* R; K8 u9 s3 x9 o# \5 F; ePrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
8 k/ Q1 H! ~ ~/ P Dim vItem, tbl, Temp 3 `" l0 T; Q6 W8 n& F- F
For Each vItem In Collection + W' |+ ]. ?+ T5 J5 E$ [) t4 G
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
* P2 u- k) K3 n2 B( b7 K) r/ _ f tbl = AddRow(tbl, vItem, "{object}")
) U: z+ J1 v/ B5 P6 W, k- `6 } elseif isnull(Collection(vItem)) then " v0 i: X: o8 h% p( b2 I
tbl = AddRow(tbl, vItem, "{null}")
& n3 W' F9 X( i" L# C elseif isarray(Collection(vItem)) then
3 m2 c8 h0 c) K8 T1 D tbl = AddRow(tbl, vItem, "{array}") 4 o# w+ \8 q" E" k
else
% i8 Z4 {6 S8 X5 O if dbg_AllVars then
; k5 E1 J/ x+ c6 v4 | tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) - u$ S4 H8 f/ h0 B6 m
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
9 P/ L' J% K0 O if Collection(vItem) <> "" then
/ n2 o, h" J, c3 C tbl = AddRow(tbl, vItem, server.HTML H4 D# I% _: {; I! u9 j
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
2 L L b+ O- Q8 Q4 ]! @ else
. a9 w! O# ^2 h3 @, A* u5 ]- [ tbl = AddRow(tbl, vItem, "...") : G6 H; b+ [+ T! C
end if 1 t6 |, r5 Y+ Z5 m C
end if
" G4 S" C% r4 k0 |& @8 ? end if / m6 i0 d3 f! `" V$ {
Next
3 s" `9 a& m3 W1 x if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
5 F3 Y3 ~+ O( m1 u( }: M% o tbl = MakeTable(tbl)
T# ?# d- Q# _* q/ ^ if Collection.count <= 0 then DivSetNo =2
6 G' g! d: `1 x- ?1 s. i tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
0 p$ ]) l' q# c9 a tbl = replace(tbl,"#sectname#",replace(Name," ",""))
/ ~1 A1 E! [# \. w) k1 _ Response.Write replace(tbl,"|", vbcrlf) + P% C- c( E0 ~+ T7 Z, C$ b# C
End Sub
, o; T/ M& k" ` " l9 I& b' k- O a
'*********************************************************** % i( v4 R6 R1 R3 g, @
'* AddRow
: ~4 S4 j( _9 c, D @. r, N0 q'*********************************************************** / d. a; C6 F" ^/ a0 U2 r
Private Function AddRow(byval t, byval var, byval val)
! W5 d4 D4 J- ?5 G5 T t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
) o: d; P) o1 Q( V6 C. a$ R AddRow = t
|$ Q7 v& P% _& n- xEnd Function </P>< >'***********************************************************
- `, y. s% L3 @0 m2 z$ W1 H'* MakeTable ( L) H& { e# Z! d3 S" G" N2 ?
'*********************************************************** % w- O- b4 p4 P7 w
Private Function MakeTable(byval tdata) x O; a5 G5 S0 m# Q4 i
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
+ L: w9 C4 k2 ?" Z MakeTable = tdata
' { y. ~$ U- I3 p) r! PEnd Function </P>< >'***********************************************************
: P+ b6 _7 K, H' P''@SDESCRIPTION: Draws the Debug-panel 4 w: x' g2 K) s" ^3 U' j
'***********************************************************
! j" W5 N8 J0 F% @/ u2 Q* }* tPublic Sub draw() 6 \1 `3 I# r, R7 ]" _' O
If dbg_Enabled Then
, r. l& u& ]$ O/ U; r% A dbg_FinishTime = Now() & v0 v& E% b/ ^0 h8 x2 m, {) [6 U: H
, l1 P& T8 E- |4 J Dim DivSet, x
; S' C. ]" Q: T! a' i' f4 V/ u* o: `! q. M DivSet = split(dbg_Show_default,",")
- S" O# G( s g% L; Q3 N6 `/ | dbg_Show = split(dbg_Show,",")
; S# X2 C5 {* t! `7 x $ ^1 K0 S. x2 w O
For x = 0 to ubound(dbg_Show) ' d; r" B% L% h
divSet(x) = dbg_Show(x)
# V. l! @$ `7 S4 F Next
; p# N) D4 T- t$ ]6 _. e2 { - C8 w+ X2 ]4 k, 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>"
: j1 |7 L/ e5 u( |4 f: I+ |2 e# W Call PrintSummaryInfo(divSet(0))
4 \4 ~% E& ^! u$ i a Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ' Y; u4 r. z, r8 S
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") 5 z* S0 ]1 ^9 ?# D
Call PrintCollection("FORM", Request.Form(),divSet(3),"") $ Z! n* @' I) r- ]4 U
Call PrintCookiesInfo(divSet(4)) / C$ m% S8 C$ L7 L; i+ {5 z
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)) 2 v9 H, C8 |/ e! I S# r( s
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ! i" v6 Y8 z7 |& z5 j6 P: v
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ( _ l' a: L2 ]0 B
Call PrintDatabaseInfo(divSet(8)) 0 g% a% Z, \3 q4 P
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
2 \+ N; i3 m' D5 U( I9 |4 ` Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") ( ?: C7 p3 `) E" ]0 `( N: k" H
Response.Write "</Table>"
# J3 z, H" v/ M# a8 S2 | End If ! W. Q- A. M0 \4 E7 R: x3 p
End Sub </P>< >'Destructor , G' f U. ]0 M( r
Private Sub Class_Terminate()
+ d8 {& f T% h' |' e9 k Set dbg_Data = Nothing
1 x% Q' @' e ]8 v R# EEnd Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
0 V1 c0 D% ?& I. b" bCLASS debuggingConsole 6 b3 o$ v! i; E2 h
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
7 s ~# O' m. G# J3 Z9 o&n
# L# l0 t: u: mbsp; 6 T/ A; Z% L- |6 i5 E" P9 R0 k# `
Property Get Enabled===[bool] Gets the "enabled" value
* L$ h& S( R, h- E) b
. Z9 ]2 {* r [; G# z. ?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 4 @' g! C! O8 b+ r
9 \! z' s: @9 [$ H3 ] S: q( L( k
Property Get Show===[string] Gets the debugging panel. & s }1 |1 r( @' _, H' \* \
: ^( n9 {: N8 H# {$ V9 V0 Y' [
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>< >--------------------------------------------------------------------------------
8 ~- S! _3 Q9 F- W& {5 FPublic Methods </P>< >public sub===Print (label, output) : w, O' M( r! j# E5 q& ]
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) : W0 [% w. S' D6 \4 Q$ E# j7 x5 I! t4 i
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () 3 p, m" C9 w/ p5 I0 Q' T
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
$ z# _5 q, y% Y3 @4 m/ SMethods Detail . `) I" i0 }" P. Q6 e
1 Q5 z' V8 \. J% {) kpublic sub===Print (label, output)
* q4 v: k# M% s* \% j2 D8 a5 N; IParameters:
: v5 l# r7 U2 A/ ^0 R" A* P! } - label [string]: Description of the variable % Z! t: B+ z& W) c- T# m
- output [variable]: The variable itself . C- y8 K0 U" W j; m1 a- d
+ K+ E/ {% c" X5 h6 {$ h5 ~
public sub===GrabDatabaseInfo (byval oSQLDB) 0 f0 J+ X5 V+ P5 t' M. w8 s
Parameters: : X$ X2 _0 M" s% t- x" l
- oSQLDB [object]: connection-object</P> |
|