- 在线时间
- 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"))
- ?, [. m% j/ c& y$ w dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
( F' F' G- Q% s& yEnd Sub < >'***********************************************************
' ?. y6 @/ X) q. c" w1 a+ o'* PrintDatabaseInfo
9 k5 Y; H9 C2 y7 y% y" ?2 R& s4 C'***********************************************************
5 d( i; Z. d& _ i- z/ v! D* W3 oPrivate Sub PrintDatabaseInfo(byval DivSetNo)
$ \+ | {* J* y6 | dim tbl
! H ^7 ^# Y+ y7 `% \ tbl = MakeTable(dbg_DB_Data) ( I8 C1 i8 s. M( u
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
0 x. h; @3 M7 y# O Response.Write replace(tbl,"|", vbcrlf) 0 e. L: o. V6 l4 L
End Sub </P>< >'***********************************************************
- \ R, `# o; V, }+ p. z$ n'* PrintCollection 3 v' c9 R+ D9 t+ x5 o9 L. d! p, @
'*********************************************************** 9 a) ~: B% Y* w
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
i7 p: \2 S4 p7 F Dim vItem, tbl, Temp % u0 Q0 L$ I3 Y! n, Y
For Each vItem In Collection
! K9 u6 D: o# K' W( A. M if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then 6 e: X+ p, C2 X" r
tbl = AddRow(tbl, vItem, "{object}") ) H( C. x2 S, s) C
elseif isnull(Collection(vItem)) then
" P; v4 ?$ V. R8 ?( b% o$ G* T& Q tbl = AddRow(tbl, vItem, "{null}")
' E% u0 ?" q. z4 _0 a" U elseif isarray(Collection(vItem)) then 5 e* p# G+ v+ d+ D5 m
tbl = AddRow(tbl, vItem, "{array}") 8 ]" k& x+ f; H+ `+ y7 f4 Y3 v
else ; m- _. i4 C+ i: @
if dbg_AllVars then ! a/ i/ m$ q6 I$ |9 ^ y, h9 O, u
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 2 ^; o! [+ {& n. @- S
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
- R' z9 z/ y8 {. v$ M if Collection(vItem) <> "" then
( P9 h% l, s+ ?6 x1 m tbl = AddRow(tbl, vItem, server.HTML
. g6 F/ j7 x2 |2 L6 kEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") ( T" `8 m* [ v+ o+ B; s
else
, `/ _- |: w! v7 J) A tbl = AddRow(tbl, vItem, "...") * m' m) A) V0 e3 r9 F2 q6 L- Y1 f: M
end if - M& y+ w4 M) i9 V% z
end if
: t/ A7 e$ Y. H& |/ w" i' K9 s end if % d1 ~7 k d% |9 V T5 s6 m
Next
1 q7 ]/ d" I) @# g; i2 W if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo - F: C0 c" [9 w. C4 F& g
tbl = MakeTable(tbl) / Q! n# c% J1 }
if Collection.count <= 0 then DivSetNo =2 ) J: C7 ?9 z. g: W2 |# u- _3 G0 @
tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) # n {6 D! C0 n' ~3 ~8 m
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
+ P5 v. D! d' n% v8 S0 B7 b Response.Write replace(tbl,"|", vbcrlf) ! Z7 Y8 Q$ |) W8 h* K( H
End Sub
/ @& o& A8 R4 n$ L: z1 a% \
) v) F6 q5 P$ g0 X'*********************************************************** / W( x$ t5 a7 a. U5 @% U
'* AddRow ' H0 f1 Z+ L4 O' Y
'*********************************************************** # z; b: {# I& E4 Q% F1 D
Private Function AddRow(byval t, byval var, byval val) 4 H, ^: h' ]' E& _; m3 B
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" # q o8 w% d) o! i3 E ~
AddRow = t
2 z; S6 L) g9 E6 e1 v6 s; @. ZEnd Function </P>< >'*********************************************************** % A% w9 s, U9 W0 Y2 `
'* MakeTable
9 H0 g+ w S8 @7 B'***********************************************************
, y* ]$ E4 V- y( s/ T9 e0 lPrivate Function MakeTable(byval tdata) 3 ?( A5 c! q* f( G5 b
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" ( P6 a% v9 r+ Z u& t
MakeTable = tdata
7 j2 k( k8 m( yEnd Function </P>< >'*********************************************************** ! [' \2 C2 H6 {+ ^1 q/ G
''@SDESCRIPTION: Draws the Debug-panel
) h# X; P3 j- |'***********************************************************
1 N* @5 m* f2 f! sPublic Sub draw()
- p% p: t! D" M- s) X If dbg_Enabled Then
9 Y% Z6 p. e% S( j, [; F dbg_FinishTime = Now()
1 ]6 f2 _1 H7 [( H/ V( } # w9 b. ^) o% _2 n6 G8 y1 Q& x6 v
Dim DivSet, x
8 j: @1 u4 e1 e4 S DivSet = split(dbg_Show_default,",")
. k2 L, r4 u2 k% F dbg_Show = split(dbg_Show,",") " a0 ^) c2 p' k8 e" h# S4 P
8 f* S3 J! J+ [, s/ A& z# L: |# J' p
For x = 0 to ubound(dbg_Show) ! C3 \) K& e; ]9 Z6 P7 x# [
divSet(x) = dbg_Show(x)
& z7 r8 F5 @" w2 n8 Y3 P7 j( } Next . J* \) n7 _2 K: h
% ^/ x* Z! B7 P3 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>"
9 A, q! }- R+ R# s9 | Call PrintSummaryInfo(divSet(0)) + j+ D K* u/ U- m5 Y
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") 3 N8 S; A5 G( G* P9 g9 }
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
! F: S: l1 h5 Q, F Call PrintCollection("FORM", Request.Form(),divSet(3),"") & ]$ U* I8 r5 C: E' G
Call PrintCookiesInfo(divSet(4)) 2 M+ U* u+ n2 V- F; v* ]9 K
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 C4 J: c& L8 b3 Q: i, x
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
6 k" L. Q v( ^. ]* {0 W7 R7 D6 S4 A Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
' @: j5 N- C8 { \# ^5 g" A Call PrintDatabaseInfo(divSet(8)) ! X; g+ A+ i/ N2 E6 ~+ w
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
( |! Z" ^' {3 S; }0 a Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 6 b7 r! ]; W- G7 j- J1 P- F4 m- a- q/ A
Response.Write "</Table>"
2 d. e. u* H2 E4 L5 v End If $ h1 M/ A- b7 S7 A: ~8 z
End Sub </P>< >'Destructor
! N9 s: W7 _0 J, M6 G1 |Private Sub Class_Terminate()
/ ]! c# s1 S9 x7 E, q Set dbg_Data = Nothing 3 V: N! h' w7 |
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >, W/ ?9 @, _2 F" `8 t* P1 q8 h
CLASS debuggingConsole & c; h6 x# H+ r) B/ U4 ~+ Z
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
* V' N* C% p9 X&n
2 V8 N, [/ g: `# Z! E- r# Ybsp; / O0 x+ N5 u3 L2 W
Property Get Enabled===[bool] Gets the "enabled" value 3 Q4 A2 Z d- {3 v I8 v! g
o0 _0 c$ S% L' z. Q4 l* bProperty 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 # z0 ?! s, X4 R9 L/ [
4 N/ A( C7 `' p7 M: _Property Get Show===[string] Gets the debugging panel. $ y" x* W/ s/ o0 T
0 Y& Y; s/ k+ u$ @7 K
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>< >-------------------------------------------------------------------------------- # a, b [( e! M1 x. B
Public Methods </P>< >public sub===Print (label, output)
7 X. d6 C+ D, `8 P8 b% k Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
4 B) w8 [) t, P# d6 F7 Y Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () ; e7 ]3 H7 ^: [8 [. F
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
0 i$ C3 c! h2 f! g9 |Methods Detail
, z0 l5 t' O: O9 M# b {1 B " M# ^9 k& Z: H) h
public sub===Print (label, output) ( I3 j7 ^. d. o$ u4 E& g4 ~
Parameters: 8 B4 w3 t/ e( q! d3 C$ |' r7 w
- label [string]: Description of the variable
6 v( n0 k: _0 J ~2 P* h+ y) R( L - output [variable]: The variable itself ( e {* \, ]( A. D) A) B
3 \3 s7 s4 B: D! W9 v
public sub===GrabDatabaseInfo (byval oSQLDB)
" B% y- j; `0 t0 nParameters:
: n; L+ S! [1 C. h+ \. f7 u2 m - oSQLDB [object]: connection-object</P> |
|