- 在线时间
- 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"))
1 X& F6 Z2 q+ g' K dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
9 F& X9 {) G) i2 B8 Q- LEnd Sub < >'*********************************************************** ; l5 {0 `+ h& f$ z4 _+ c5 c
'* PrintDatabaseInfo " G1 q: r: v5 h( z. }2 Y0 H! I( |) U8 p
'***********************************************************
/ ~) y2 ?. k' i2 V) HPrivate Sub PrintDatabaseInfo(byval DivSetNo) 7 f v8 w3 P4 o$ Q' ^2 j% c- Q) K& R' r
dim tbl 6 H- ^5 e$ e/ e; S
tbl = MakeTable(dbg_DB_Data)
1 E1 Z$ b2 ^5 B% @ tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) ; N& f2 b$ p- G% e" N
Response.Write replace(tbl,"|", vbcrlf) / @ |' D. b/ N4 N
End Sub </P>< >'***********************************************************
5 Z% z. T% L% p) Y" W4 w5 B% W'* PrintCollection 6 h' b' ^2 P7 k( L
'*********************************************************** ' g' {/ {) l# B+ o; P
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
, _% d# g0 v1 W* R Dim vItem, tbl, Temp 5 O9 H; ?" q4 [% {/ a6 Z$ g6 q( A* e
For Each vItem In Collection 0 N8 j2 H. [& E c/ f* i6 p7 E; l
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
( N& N+ J0 N l tbl = AddRow(tbl, vItem, "{object}") 4 F# z C. U3 M" `" m x" S
elseif isnull(Collection(vItem)) then 4 l: v$ n( R$ a @. b
tbl = AddRow(tbl, vItem, "{null}") / D) f F4 r- D _+ r$ y+ h
elseif isarray(Collection(vItem)) then
" Q6 F" i# i1 a tbl = AddRow(tbl, vItem, "{array}") b; D/ e- o# Z+ Q. Q' N
else
- G( U6 P' c; ~- _ if dbg_AllVars then * \% U" u8 i, _; q; x! t
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
3 N1 \: o' R& k elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 3 f" n& o0 b/ e! S3 C
if Collection(vItem) <> "" then $ O A) Y5 c9 D$ T* E( l
tbl = AddRow(tbl, vItem, server.HTML
' h1 W1 v5 N: AEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") 9 m4 Q7 A4 S* V/ |; l
else
8 E$ K6 e$ C/ \2 n1 Y9 } tbl = AddRow(tbl, vItem, "...") & G! |& h' i. ~
end if
8 E. F; l9 h5 y end if % @' p4 M* q* n+ s% O
end if 8 ]6 [" ^' Z5 k; \+ g
Next
$ E' ]( i" Q2 y: S: _ if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo 3 n; ?8 X$ b0 l# Z4 V
tbl = MakeTable(tbl) ! {+ u. l9 L& q
if Collection.count <= 0 then DivSetNo =2
% b8 a" y# K6 x1 W1 `; s tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
7 |; @; P' \* h( G4 {0 b/ C tbl = replace(tbl,"#sectname#",replace(Name," ",""))
1 E9 t7 m% D" P1 A Response.Write replace(tbl,"|", vbcrlf) O2 j* E, A+ |) h; n+ E( B
End Sub
2 O3 C1 x, f. V. T
9 M* w7 h$ L- z: P2 [! r'***********************************************************
3 _! h; B2 K" c1 r t'* AddRow
) i" c5 H' d% Z1 P'*********************************************************** : r% H& d- }4 E1 q
Private Function AddRow(byval t, byval var, byval val) 3 O+ X" y2 W) D: g/ _* v8 \7 t% X
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" m+ {) G4 c: F) L: K8 |
AddRow = t ( x. X0 q* }" [
End Function </P>< >'***********************************************************
; ~+ q. i. E0 L m! E: p2 t'* MakeTable 1 ^! y9 ^; {/ Z# R% Y
'*********************************************************** ! z. s1 b7 h y3 E2 F! q; j0 R U T2 k9 _$ j
Private Function MakeTable(byval tdata) ) m0 d; D M. M5 y0 |# s) i
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" 3 Q. t: W% N9 n: `4 F6 u
MakeTable = tdata - R6 a* y3 S) @( U3 x
End Function </P>< >'***********************************************************
# R/ A4 }: P! H6 z% j! Z''@SDESCRIPTION: Draws the Debug-panel
3 U" N! B" z/ D'***********************************************************
4 C$ E' Y$ R" k8 B! h! KPublic Sub draw()
3 a% p6 D8 c% a* o8 z* Q If dbg_Enabled Then
6 m8 p4 ~6 V2 C0 A. Q, a; I dbg_FinishTime = Now() % F) k* @# R6 O2 _4 O8 _
7 u5 ^8 Y! X& b5 {0 }4 J3 j$ X Dim DivSet, x
# e9 d7 Z" Z0 n9 `8 W$ o: m. O3 m DivSet = split(dbg_Show_default,",") , F C/ r* I% P8 ^0 u' ?0 l
dbg_Show = split(dbg_Show,",") ' W) j0 C( a, b7 U- Q6 [7 z# Y
! f0 f" o! v. J8 i: ?& B
For x = 0 to ubound(dbg_Show) 4 s& ~6 u* S4 }! U
divSet(x) = dbg_Show(x)
P; N' b9 c6 s2 U$ w: f" w, V: J Next
4 v, H9 u7 c- F5 v. i
' |# K8 |1 G% b" K! z: T1 l; U 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>" 8 D5 J! h% |3 [( R
Call PrintSummaryInfo(divSet(0))
8 G7 a6 R3 R5 ~; m0 W6 `# m Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
* k# j' m( f5 i2 M6 X Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"") # |0 e! a6 W# e& W( V- a
Call PrintCollection("FORM", Request.Form(),divSet(3),"")
, _% |! l; R3 k0 X Call PrintCookiesInfo(divSet(4))
& c! W; W7 }5 }$ k0 _ 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)) % Y( _2 F2 l9 k6 w" M
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 8 e1 d2 \8 r8 B& J' f2 n
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ' h+ q- l) Y- Q5 Q) [
Call PrintDatabaseInfo(divSet(8))
+ E& y% d& z2 z$ y Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") : J: V. j" q# y+ p7 R% t) w
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
) R4 v8 v) M/ Q; T: g Response.Write "</Table>"
% m. X& K4 ]1 ~4 T( P End If ; j0 B& d. P4 o' W T7 Z
End Sub </P>< >'Destructor
& ^8 y3 ?: H# ^) |9 C+ nPrivate Sub Class_Terminate() 2 M3 P3 [( b B
Set dbg_Data = Nothing * Z W! O) [8 h) m/ j9 ~& \
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
" a; B, O8 F7 M g) qCLASS debuggingConsole # Y1 w$ b. \4 p% ^, K0 S
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
) b5 ?. q" j) {& H* k&n* Z/ a3 ?' V" C) t" y9 X! b
bsp; / k9 d7 U0 e K+ n/ ?/ o( }7 D2 {
Property Get Enabled===[bool] Gets the "enabled" value
A# C+ D6 ^ |& g 3 `9 d! n& [# F6 B s
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
0 y% x2 L, N2 L
& v, x# c0 D" g9 I- q4 K" pProperty Get Show===[string] Gets the debugging panel. " }1 m: W9 j; j% q5 n
1 K' m1 R, {7 x, U( N% M% L9 Z9 L6 s
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>< >--------------------------------------------------------------------------------
U0 n1 T# j% bPublic Methods </P>< >public sub===Print (label, output)
: X4 f) ?( H+ S' N2 ~/ ^ Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
/ v% T( U: Q5 i& L" V Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () % Q4 x( g5 Y% H( z6 K* d b9 ^
Draws the Debug-panel </P>< >-------------------------------------------------------------------------------- $ z, ~" O1 p4 S8 O% h6 A9 Y
Methods Detail ( O+ R7 M% ~* ^* L$ V7 s% E
1 e1 k; ~' Z4 z3 ^2 ?* ]& F9 r
public sub===Print (label, output)
: y! @" i, ]* e7 Z2 h4 wParameters: 5 P- R6 q* p: P7 c
- label [string]: Description of the variable
; K% E! i" ~7 o2 m# d. Q- U: \ - output [variable]: The variable itself & l+ P5 H Z7 v
2 [$ V" g2 s/ T$ h) ?
public sub===GrabDatabaseInfo (byval oSQLDB)
[& x( D; e8 D# k S9 C8 o/ bParameters:
+ {, ?0 O% b5 u/ O8 ~+ B- k - oSQLDB [object]: connection-object</P> |
|