- 在线时间
- 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")) # v: j! A9 Q) C6 f! E
dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
) X! f. t5 }) S: t5 X) l0 c; TEnd Sub < >'***********************************************************
) q* T$ p# Y6 Z' j! Y+ p0 R'* PrintDatabaseInfo ! F/ e. H* A( \/ T% x- ?# B' j# C
'*********************************************************** & W% l- m9 P& v2 K y
Private Sub PrintDatabaseInfo(byval DivSetNo)
% W2 g$ F4 i# r. K5 a/ c8 U dim tbl
2 s, w0 z1 z+ X7 R2 H5 Z tbl = MakeTable(dbg_DB_Data)
# ]9 f( ~- i0 p tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
3 J4 A; Z- D$ Y" j Response.Write replace(tbl,"|", vbcrlf) ; V0 A( D2 O6 W
End Sub </P>< >'***********************************************************
% U4 ~* p- C6 N'* PrintCollection 9 p3 [1 O0 r# u- J: `/ C2 ^
'*********************************************************** ^3 Y5 ]4 z4 `4 Q; B2 U1 o; X2 i
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
" |! z7 B* v5 r. R9 \& a Dim vItem, tbl, Temp
# x8 F. @5 H6 W I* ?8 }' S For Each vItem In Collection
$ b" W% E+ m/ M- j. _5 i- }" ^ if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ( }. N- o/ t$ P; `+ R4 m* t! Q
tbl = AddRow(tbl, vItem, "{object}") : T1 ]2 z" X5 z% z
elseif isnull(Collection(vItem)) then
1 j% s& N5 U' O$ G4 b @- G/ U tbl = AddRow(tbl, vItem, "{null}") : y; Q( r4 x4 V2 X
elseif isarray(Collection(vItem)) then % Q! v R$ U" F: q4 A! ?& H+ P
tbl = AddRow(tbl, vItem, "{array}") ( a! s& A3 _/ G- v3 ^+ T l+ r
else
% g* j: y+ @9 ?* B9 w if dbg_AllVars then
/ z. Q/ ~, V' c tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 4 f/ p" b/ a/ }( {6 N9 J
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
* Y' ^4 B, x, H/ v if Collection(vItem) <> "" then
0 e- q4 l3 l' _7 N/ ?7 f tbl = AddRow(tbl, vItem, server.HTML
# y2 }6 u' s% W* v4 S4 q' \Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
0 Z" D& T2 {% I. M4 J else ; U: B% H: Q! n* \. M1 n/ z+ w1 ]2 u
tbl = AddRow(tbl, vItem, "...")
7 I: R+ z- w' |, t end if 6 D. Z' @9 a" a3 o$ H- r
end if
3 r- }0 o1 K" |4 n f! z2 D end if , p6 P0 x! @2 C ~, O8 b9 d
Next / M! n0 K1 t( M# q% y6 S5 p/ W1 `
if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
9 z @$ ?1 _, ]0 ` tbl = MakeTable(tbl)
# l7 r+ c+ O) Q3 {5 c& q if Collection.count <= 0 then DivSetNo =2
3 g$ k0 u) u; |5 D' j tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl)
3 Y& c4 ^1 h7 m7 m) y5 h6 i6 [ tbl = replace(tbl,"#sectname#",replace(Name," ",""))
, q* |* S9 F; a5 D; V/ B7 a Response.Write replace(tbl,"|", vbcrlf) % ~5 H/ L) _* N2 q {
End Sub $ d) r" K' M2 { k* c+ p5 J3 k! k6 R
* D& p' i, T0 L. q0 E% j* V'***********************************************************
+ @% m3 F" n" H2 F0 D( n; ^'* AddRow
2 r' C4 r- d+ a+ N* p8 l: Z'*********************************************************** 2 U9 B3 C) ]9 W
Private Function AddRow(byval t, byval var, byval val) . i# _/ x! T* Q% i
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" % v* ^4 s+ l" z6 G, l2 }$ Y
AddRow = t
* Y9 k k- b9 q% D& [. o* FEnd Function </P>< >'***********************************************************
" y2 k _& M; x7 v. w2 h'* MakeTable
( g, s9 r; `' |7 A" X) w; H'*********************************************************** # w8 Q* Z' u4 x( m
Private Function MakeTable(byval tdata)
; U. {' y' r; b0 M u7 Z: a2 l tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|" ! J/ y& q: l. _" h4 T6 |- v
MakeTable = tdata
3 m" ^5 m6 A6 t! m( m2 ]* wEnd Function </P>< >'*********************************************************** & t1 ^" I7 ~2 T1 V# K& a- ?, M
''@SDESCRIPTION: Draws the Debug-panel 4 h, g) w1 }* A/ \ ]
'***********************************************************
$ ^4 |9 }" l4 i5 c# r1 bPublic Sub draw()
9 F7 W% q$ m7 G5 O/ i5 T0 b If dbg_Enabled Then
( t+ [6 ]: H4 x3 Y. [7 @ dbg_FinishTime = Now() 0 G% f- V, Q' {/ `' s' ]) b
! f5 t$ g# c4 U X2 V7 G. U( _' u Dim DivSet, x + k9 T |/ \2 m H* R3 j8 y
DivSet = split(dbg_Show_default,",") 8 g- u, ?) d$ C$ \* R8 p9 R5 a
dbg_Show = split(dbg_Show,",") ( Q8 V) m! k g9 V+ [
/ z9 u. Z& [. o1 \7 j2 I
For x = 0 to ubound(dbg_Show)
1 o2 h! |" z R* z divSet(x) = dbg_Show(x) - y, t) H: k+ Y- H5 G0 k
Next
4 R& D( k c6 y8 k/ s5 ~ ; ^5 Z' W$ P; h, k' o
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>" 6 X; z" C% z8 o' y" B& n0 }; V1 V) `3 d
Call PrintSummaryInfo(divSet(0))
+ m1 f1 b6 \5 r+ g6 C Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
. W& Q4 L, @0 ^0 u! k/ d! \' g! `& _ Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
$ Z8 P1 F+ ^/ Z- q% I7 r( g Call PrintCollection("FORM", Request.Form(),divSet(3),"") 3 u( ^9 @$ q2 I% I5 E
Call PrintCookiesInfo(divSet(4))
9 x3 [1 n Q1 l, F, U( D 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))
' M0 i2 [6 Y3 A" g0 f9 I5 d Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
) m7 i( m0 n/ K7 c Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) ) ^% @. X* o6 G& K
Call PrintDatabaseInfo(divSet(8))
- Q: o3 B# @+ @6 J: ?$ e$ J$ C5 v Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"") ' l$ y9 `, C/ Y3 b( e7 i+ e
Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
, c4 [) Y; {8 ~& H9 N9 { Response.Write "</Table>"
* z* L/ y' Z `! p- m, }" D End If
$ K3 p* B0 J; s, ^3 E! u2 ZEnd Sub </P>< >'Destructor a+ g0 h5 b* i
Private Sub Class_Terminate() 6 b0 Z2 y3 B1 q4 O+ s# _7 {/ ?% \
Set dbg_Data = Nothing - G7 H! h: @: e l/ H- V
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
5 L5 v0 K, @, CCLASS debuggingConsole + ?- e9 A# q% v0 G7 {. L, B- t& r% v
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false
" u) ?0 C7 H2 n: B&n
$ x9 L( ^1 N4 b+ \, c7 B8 Hbsp;
" b& Y6 w- ^% T# U! e4 [; mProperty Get Enabled===[bool] Gets the "enabled" value % S( t& T3 p6 _8 F
) Y) k' d& q, 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
: m& s2 X2 v0 W/ }% n! t' W) B
7 e) b- T; v9 OProperty Get Show===[string] Gets the debugging panel. : l1 n$ ^7 p$ e0 v
: r7 U& B" ]1 h9 u0 N
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>< >--------------------------------------------------------------------------------
4 h( W1 J; O& K/ Z# x4 TPublic Methods </P>< >public sub===Print (label, output) : Z- ] s, p+ P/ X" r9 g
Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
" T5 u- v$ X; `3 X) Y Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () " N) D N4 x6 p+ X( f
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
& A# U% c& z' b, ?Methods Detail ( L. c2 p% y1 t
$ U& T# K" u" }! ypublic sub===Print (label, output) ; U2 R$ B* J) W5 C3 Z
Parameters:
9 |- ?3 d2 L b$ ]! u2 q! |: \ - label [string]: Description of the variable / ?+ i* Q8 L8 B5 z. r: Y$ w: j7 b
- output [variable]: The variable itself
; V, \/ S. I2 f) j. G, G0 I % V/ k, m8 R7 s+ |) G
public sub===GrabDatabaseInfo (byval oSQLDB) 2 t3 I2 P; k% p+ T# f
Parameters: ; k4 l. N9 N( @0 h" T
- oSQLDB [object]: connection-object</P> |
|