- 在线时间
- 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$ B7 q) i7 o7 c" h( | dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
1 I0 A! o$ R8 J) Z' @5 p" ^9 x2 ?End Sub < >'*********************************************************** , v1 \: e6 y0 {& \; o: q
'* PrintDatabaseInfo g" U6 x" l: @% r" m* _
'***********************************************************
8 z/ q# H5 E- M2 OPrivate Sub PrintDatabaseInfo(byval DivSetNo)
. q* x5 S( B5 w* y9 L dim tbl 0 F6 H0 \! d6 Y: U0 O. U* w* B+ D
tbl = MakeTable(dbg_DB_Data)
. \1 t; H8 a( @3 \ tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) 2 M/ s: n6 @: z6 W" n9 J( q$ m0 b4 ~2 `
Response.Write replace(tbl,"|", vbcrlf)
; w) b+ s! Z* P2 E! Z5 ~( vEnd Sub </P>< >'*********************************************************** % w4 u- Y9 X0 W. i6 Q2 ]
'* PrintCollection
: j. Y: o5 f, ~+ a0 |+ A'*********************************************************** 7 q0 m9 S3 V* v
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
0 A. I$ @7 [( w6 u/ z Dim vItem, tbl, Temp
' H5 ~4 k6 w$ i- D3 @ For Each vItem In Collection
t: h R+ F. o" l9 r+ n' n$ h0 s if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 5 u, v2 M4 A- e1 f* \$ J# u4 B
tbl = AddRow(tbl, vItem, "{object}") : F- k1 C' U; a$ p% _9 H
elseif isnull(Collection(vItem)) then
2 B) N$ u7 A% K tbl = AddRow(tbl, vItem, "{null}") $ @- w! n1 X7 w4 u1 w4 A! ?, S
elseif isarray(Collection(vItem)) then
3 E$ N3 b# J; r, \ o tbl = AddRow(tbl, vItem, "{array}") 7 ?/ M, x e* M+ H" F% d
else
" ~6 Z$ k! u7 I1 ?8 j if dbg_AllVars then : y1 c. S1 }+ ^) G2 y& x
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
4 N) u9 Z. |3 g: i elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then + I" Z3 d8 a4 h1 s( D4 i: F! M
if Collection(vItem) <> "" then 2 o: @' t' [4 f4 M" V# _
tbl = AddRow(tbl, vItem, server.HTML
1 R( U \& R: I( N% ~6 c/ @Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 4 F0 T2 h, U8 q, ]6 ]" t
else
0 F5 W( L2 A' y, y" W6 Z tbl = AddRow(tbl, vItem, "...")
/ R* K, j7 t9 ^ end if
1 t6 s- y3 t! l3 n, G end if ( N" T) _& c* C" I
end if
& W1 v8 r0 R" m' g c( O Next # D/ R$ ]$ H+ e$ k
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
8 a( P) b/ `! ` l1 W( j tbl = MakeTable(tbl)
% l) d. e; w. A( N if Collection.count <= 0 then DivSetNo =2
8 p) Z: t1 M& G tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) : }5 w# n" \2 R
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
$ s% {2 J/ ?# W! \7 C Response.Write replace(tbl,"|", vbcrlf) 3 |1 u2 d4 f6 t% c2 k1 D; S3 H
End Sub
' v, ]$ W1 b4 z! q! F: ?5 [& e
, v$ W# \, |, a) `. A" l' f: }5 h'*********************************************************** 8 u! v' U6 W" q$ U
'* AddRow & C- z, [4 I# N7 J( \. y0 a
'***********************************************************
6 i; J5 U* U9 `- _6 V* ]Private Function AddRow(byval t, byval var, byval val)
/ W' k, R. b' M# {5 A. [' p t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" : ]% c3 E0 `0 n
AddRow = t 5 ~/ v2 ~1 W" U
End Function </P>< >'*********************************************************** ( [+ p$ Y# j O
'* MakeTable
; u( z/ u7 v4 g3 G+ l'*********************************************************** $ F, o+ K* O0 X" R& v# E8 ]
Private Function MakeTable(byval tdata)
+ |; L5 p/ J+ n8 l1 i tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
4 C3 \. w+ C6 A% O* I MakeTable = tdata
% L, }+ K) n/ M* b- uEnd Function </P>< >'*********************************************************** / w n+ R! O2 i& c/ C" l
''@SDESCRIPTION: Draws the Debug-panel
. x6 D; k9 J( {, G) Z3 F'*********************************************************** 6 ]+ K# x1 I2 j
Public Sub draw() % }( _8 B+ G, L4 A B7 W
If dbg_Enabled Then , U+ n$ r/ i& w7 u. z% L
dbg_FinishTime = Now() 5 v: r2 @/ M# ]2 J+ L$ r8 ]
/ Q9 m: r8 x: e: J4 n Dim DivSet, x : k2 }. I* ?5 S6 K2 o9 e
DivSet = split(dbg_Show_default,",")
) H6 v6 U. O. z4 q) h) h" I3 } dbg_Show = split(dbg_Show,",")
8 o- p E/ E- e# ~ ^ 7 j; v3 ?$ Q; `, t
For x = 0 to ubound(dbg_Show)
5 N0 O' J* H: D% O/ k& C divSet(x) = dbg_Show(x) $ p$ M8 p! R2 W6 M2 u8 U
Next 5 d9 y" K, ^! p. x4 k5 w
& x8 L8 I. X8 ?( A3 O+ a; K 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>"
2 I' F& l2 ^8 @2 H8 R* N! d Call PrintSummaryInfo(divSet(0))
$ x: m& }' r2 q8 [/ n8 ]# ] Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 2 G8 s! ]7 O5 ~; U, o! |) i4 E
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
) d" K9 [7 l% |( R Call PrintCollection("FORM", Request.Form(),divSet(3),"")
7 r1 \2 \) p/ Y Call PrintCookiesInfo(divSet(4)) & e }4 L; @0 J. y0 u
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)) 0 \* M! G; q/ f0 c! |2 [
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") ) F- y4 I8 O0 [: T0 d
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
! `& ~/ X( e' E8 K3 g# t Call PrintDatabaseInfo(divSet(8)) 9 B* K; u8 K7 d X% W
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ) }; e( N0 N% \' L' m9 a0 l' G7 j
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") ! B. q5 K* O/ j) [" l. K( H
Response.Write "</Table>" $ H- _; k8 y; V# g
End If
7 o- c$ [5 z8 q: G+ N( BEnd Sub </P>< >'Destructor
1 V8 z0 B' c# e5 [7 X* rPrivate Sub Class_Terminate()
4 z9 c. @1 E* R9 ~* e( O Set dbg_Data = Nothing " |5 }; L' l7 z1 i
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
0 G- F' ^6 B) W W" G- k) ZCLASS debuggingConsole
/ D' Y c `2 F5 H4 w" vVersion: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
0 v% J8 e& k1 A&n
5 v" }6 ]+ @3 b) b zbsp; ' {( x6 t4 K* L. ~
Property Get Enabled===[bool] Gets the "enabled" value , D2 P$ u) Z6 V% K# h
# O' @, R1 Z$ `+ K# w. Y/ ?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
. \! \% g# W1 L1 I8 @ : x9 Q- b0 s( t7 A5 i
Property Get Show===[string] Gets the debugging panel. $ p0 H% u* ~3 n P
' y, S7 ?+ z8 H# R: |8 eProperty 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* o( _9 e9 }1 k2 ^2 ~Public Methods </P>< >public sub===Print (label, output)
/ L; G& k6 H0 G6 x Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) 9 N8 M: H8 T8 y4 S# X
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () 2 t# Z7 h$ p3 D
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
2 k1 ]7 \+ X! z- cMethods Detail 1 i( T' u/ t# `5 o5 s
2 M8 X) @; g! x' bpublic sub===Print (label, output) $ r. N5 f6 U% v1 a' Q4 ^) j
Parameters:
! @! t5 U- S0 j - label [string]: Description of the variable
& Y. W! b$ a6 `4 q% \% i - output [variable]: The variable itself ; P* z" {+ i; V2 S. v5 q5 N
- W. a8 l9 |- }/ q. ^4 A" W' T
public sub===GrabDatabaseInfo (byval oSQLDB)
( v" y, \& v, ~: g$ a, N4 G! wParameters:
( U" v- D" `; D4 y4 S$ h# v - oSQLDB [object]: connection-object</P> |
|