- 在线时间
- 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")) * W1 X7 ?7 E% E* N4 F3 q9 L
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) - j `& h+ M& Q3 Q1 p
End Sub < >'***********************************************************
# K5 Q1 W$ |6 [; T# v'* PrintDatabaseInfo 2 m8 }, s* v) }. o" U6 z% h' @
'***********************************************************
4 n6 F% u) \" E0 CPrivate Sub PrintDatabaseInfo(byval DivSetNo) & T( }% }, h; T( ]
dim tbl ) _0 J4 s& _3 r- ]& R- A2 K
tbl = MakeTable(dbg_DB_Data) 5 w" @5 H6 u7 \
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) . U/ c9 {2 }6 G- i0 J) [% u
Response.Write replace(tbl,"|", vbcrlf)
* ?2 k4 x9 w! j' f) @9 rEnd Sub </P>< >'*********************************************************** 6 `/ Z& W, q. \; [% q
'* PrintCollection . U9 j# P* B+ O) D- N: c0 L
'*********************************************************** + a! F6 |" g7 W
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
# T* o6 s& P c4 T Dim vItem, tbl, Temp
+ L) s( g3 O. k8 G$ t For Each vItem In Collection
2 X3 u+ ~9 @9 I h( Y; u0 J if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
" _$ O; C* Z' ]) | tbl = AddRow(tbl, vItem, "{object}")
6 ]7 j7 j: t$ X elseif isnull(Collection(vItem)) then
8 |- O3 x( j" s! s2 R tbl = AddRow(tbl, vItem, "{null}") % _7 |3 @ `! f
elseif isarray(Collection(vItem)) then
! ^+ L( v# v; M5 k# Z5 w tbl = AddRow(tbl, vItem, "{array}") * z, d8 N/ s7 h( q' Z
else " @# i, S! S+ I
if dbg_AllVars then
; B% T# F/ j; e* v' A8 N tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
. j5 y8 q1 l8 h" e* D$ u' G2 k elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then 0 V1 D0 n) f+ P$ q
if Collection(vItem) <> "" then 8 ]% y2 q7 q, X" D n% n! ]3 `
tbl = AddRow(tbl, vItem, server.HTML
) V9 {! s, C* F M1 [Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
5 K; r( q0 y+ y( R( l6 G7 x: x) B else + _' g; E# @, N
tbl = AddRow(tbl, vItem, "...") " N7 H J3 j: I; U! r4 e: A7 \
end if
; k$ `9 c# a) d; v end if , w8 w$ `( i. f2 l/ a
end if & f& M0 w5 e3 s" f4 \& |
Next 5 W' b; f" G9 d4 W
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo . L' J, W, q: ~& v9 G
tbl = MakeTable(tbl) 6 K8 m4 D9 A) j8 {
if Collection.count <= 0 then DivSetNo =2
$ b3 d' j% G* ?! G5 Y* X3 u tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
3 j# e3 j9 U$ f: ^% ~0 F+ X- X+ Q tbl = replace(tbl,"#sectname#",replace(Name," ","")) ' a0 A# X4 n! v; J, u/ ?
Response.Write replace(tbl,"|", vbcrlf)
; ?' p$ i6 y9 g5 ~! |9 EEnd Sub & X2 _8 C+ [& E" H% {9 V: K+ a; V
" K! g1 a2 z; d& k: k( H v; f'***********************************************************
3 ~9 ^* V' U3 U' n. I'* AddRow ) d# A# a6 @+ x# a! h+ b
'***********************************************************
5 Y2 }3 m, a# |" D+ H* S+ d; E. ?Private Function AddRow(byval t, byval var, byval val) 9 o" \% t, ~1 {7 M% t$ E: a* V8 S& J2 Z
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
; q8 e5 B$ g' y4 m AddRow = t
6 Q0 ~; h7 B* t' f$ Z# o, X2 f- qEnd Function </P>< >'*********************************************************** ; u( X: Q; O! J
'* MakeTable ) r7 l/ B: a2 E: {. u- ^+ p
'*********************************************************** ) M: M$ \" z( r% P8 Z
Private Function MakeTable(byval tdata)
* g7 c/ c2 _7 f tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" , K; m$ E9 v q; h: l, w- K9 p2 ?
MakeTable = tdata
3 j+ d( d# Z/ KEnd Function </P>< >'***********************************************************
3 c5 L2 i+ V4 j+ d2 _''@SDESCRIPTION: Draws the Debug-panel
2 q( `" E/ W4 S, o( E'*********************************************************** 9 ]& j/ i* d3 b$ G' b: x
Public Sub draw() 0 f. l) f% Y1 e0 I
If dbg_Enabled Then 3 i/ @9 M* F! b) l5 z8 L
dbg_FinishTime = Now() 2 o1 H" }8 p/ d7 c" R! k
a0 h3 d; K. D% l
Dim DivSet, x
1 R/ d* m- Y( G. M DivSet = split(dbg_Show_default,",")
I' v. q; H) v- p+ u# Q dbg_Show = split(dbg_Show,",") 9 C- ?0 A' K+ h
9 `* i* z- q- v3 J2 r' ?' A For x = 0 to ubound(dbg_Show)
* j' v* f6 k2 G9 v2 [ divSet(x) = dbg_Show(x)
# C2 j, v" l1 V, h1 G* I9 Q$ | Next : i( c' ~: B4 ~& x4 t
) w$ p' Z/ [) o* E
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>"
; c+ E* |: e( }: P Call PrintSummaryInfo(divSet(0)) 9 B5 m8 U6 g1 x9 w5 G7 ?3 t
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"") ! \* ?% U, Q- L& u# b
Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
+ m9 e2 b1 h! C. \! ? Call PrintCollection("FORM", Request.Form(),divSet(3),"") % q) C- j# q- ^- V$ N& h/ d+ b
Call PrintCookiesInfo(divSet(4)) % `% @4 q: T0 _& 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))
, L3 c6 M4 F4 e) O Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
: B- w8 J8 j1 |! i E# V2 ^ Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) + R) q; n# X, K2 i# z$ V8 Y1 s
Call PrintDatabaseInfo(divSet(8))
6 ], }# [5 N% m9 ^2 N# _. m Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
. G8 @9 F# z6 K( v8 w3 j Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") 6 F5 f3 }7 D' X! x8 R
Response.Write "</Table>"
4 J% D/ f8 Y# \/ T$ m End If
6 r" z/ _$ y1 }3 @4 `. v% nEnd Sub </P>< >'Destructor % R' U9 n. w, G: L' Y- c, T; M
Private Sub Class_Terminate()
! v3 j& s6 @, u! d9 q& u8 ^ Set dbg_Data = Nothing : J, W0 w* P! @( n& l5 ]7 K+ {
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >1 T- F/ `0 q% o Z, K" N
CLASS debuggingConsole / {; N) I0 q6 a' J! v; p9 K
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false X) I% h. O% H, g3 I/ W
&n* k* l5 ^2 y# u' l7 X! P
bsp; ! a( `% O1 N+ a0 l
Property Get Enabled===[bool] Gets the "enabled" value 1 s: p$ @, W3 _
9 i; j5 ]' |& G8 ~, a7 W$ fProperty 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 @. {* F- [; J4 c1 ?2 G" }, ~ - C) U5 V/ ? R* y7 [
Property Get Show===[string] Gets the debugging panel. $ p* h8 a1 k/ ?/ u
# @5 T8 ~+ m3 A# y4 j2 C0 ?; }; c
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 C. Z* [7 {9 _5 L
Public Methods </P>< >public sub===Print (label, output)
! x c7 q* l$ L5 m o2 y6 G Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB) : N& ]$ T9 W9 K. p8 g
Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw ()
9 Y% s. J% \& b Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
7 V o0 x4 f& rMethods Detail ; i8 v1 X; B' H0 |# s' L
; `1 }# Q4 Q7 C/ O" o/ l+ K9 N. zpublic sub===Print (label, output)
1 d' \4 \2 n; V/ r+ QParameters: 9 O4 f: F) Q3 [/ v. n
- label [string]: Description of the variable 5 ^) h5 P% S! w3 [
- output [variable]: The variable itself - k4 A0 c9 P, u" H1 ^$ W; m
; `' k. [ r+ W# o5 m- b0 L
public sub===GrabDatabaseInfo (byval oSQLDB)
# O6 `( m6 F, N& }Parameters:
3 W) L) C5 T6 Z; R - oSQLDB [object]: connection-object</P> |
|