- 在线时间
- 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"))
: w5 P. h. {8 B) K5 t7 p2 A. s dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version")) % S" J/ }4 Y$ p; n3 V
End Sub < >'*********************************************************** ; i7 \4 K) ^) R5 y
'* PrintDatabaseInfo
) ^" m* d; D$ `' q( z. p0 O'***********************************************************
; G3 A j8 L. {4 ^0 z. ?6 tPrivate Sub PrintDatabaseInfo(byval DivSetNo)
+ y, ~6 u: M% p- h& @ dim tbl
" ]/ g$ H; z: I& W tbl = MakeTable(dbg_DB_Data) , @( q4 G) O- O# g% P& f0 o
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl)
7 P+ K) j# ?/ @; s Response.Write replace(tbl,"|", vbcrlf)
" n+ \1 K9 W2 Q! y0 r6 M% z7 PEnd Sub </P>< >'*********************************************************** ( D' I3 H/ `$ D) I; K% H- W* c
'* PrintCollection ) E( M4 z5 S& ]! c
'*********************************************************** 7 A6 _. X Q* u, a; v* n8 r; K; o2 m) R
Private Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo)
5 i. w$ D3 I B Dim vItem, tbl, Temp % n% x9 L: l) U9 _
For Each vItem In Collection ' V" ~; D5 Y& \+ @6 B" a
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then
B h/ w8 H. W% W) X! s tbl = AddRow(tbl, vItem, "{object}") - m' A! C8 A G# H0 F# N7 h
elseif isnull(Collection(vItem)) then 3 Z( n* F4 y/ v8 `$ @ O, c
tbl = AddRow(tbl, vItem, "{null}")
* L; B3 H7 Z$ e elseif isarray(Collection(vItem)) then
/ ]0 o" r4 w2 `, x4 y tbl = AddRow(tbl, vItem, "{array}") % \8 L/ k7 q9 N5 W2 J @8 l& p% {
else
# `. E$ g6 R/ ?$ l0 t1 K if dbg_AllVars then 8 `8 @/ R7 b1 C# O; Q" O
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem))) 1 g; N9 ?, k( A/ Z& n4 Z! W' j
elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then
* Q, d4 W( e: ~1 y9 V) j" [ if Collection(vItem) <> "" then - s3 l5 \5 A; _. \
tbl = AddRow(tbl, vItem, server.HTML
6 K& w; F \6 L; FEncode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}") + b% O% n* k: Q5 r9 h/ B
else 6 ?% B# W4 j8 G# r) u
tbl = AddRow(tbl, vItem, "...") " G6 Q5 e2 \4 C- G. h6 d4 z" `
end if
7 @" x( p' c) o1 V- ?+ F end if
/ R/ y/ V5 i2 ]# J. x* @ end if
' w: k" h4 r ], P/ t9 J \9 t Next
5 G7 S& H \6 d; [: v) ? if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
( B# B: V2 K1 h, j" { tbl = MakeTable(tbl)
" k( N) e7 c/ i/ W if Collection.count <= 0 then DivSetNo =2
, h: a* C3 {4 w! S. Q% X: H. K( B, | tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) $ O6 W H5 ]: i* U, s$ ]7 i
tbl = replace(tbl,"#sectname#",replace(Name," ","")) ' `" S- I. G9 h$ k
Response.Write replace(tbl,"|", vbcrlf) 4 R, A$ e2 w2 V& t9 K: A! w
End Sub 0 W6 X7 P& ]- d! \, Q! H) o
- G& n, L1 M, ~$ R U# f/ L& c
'*********************************************************** , g4 T" k% x0 a8 d
'* AddRow
0 V; a* Y7 l2 x9 M- z; V'***********************************************************
' n! d* B+ w7 @& DPrivate Function AddRow(byval t, byval var, byval val) # q5 i5 a: g: E7 u/ Q( S9 y
t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>" " _$ T6 {6 s5 ?( N
AddRow = t + h5 g" u0 w2 S
End Function </P>< >'***********************************************************
- j% y' l- p0 Y% {. u'* MakeTable
3 N+ D* N* o$ c& d3 d'***********************************************************
7 T* h; _" y6 |* |' IPrivate Function MakeTable(byval tdata) # o6 B4 W1 R+ ^& C
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
5 S# z% P6 m* E4 l MakeTable = tdata 9 q! U1 n/ ^* Q
End Function </P>< >'***********************************************************
0 y3 ?9 I+ O3 r! D''@SDESCRIPTION: Draws the Debug-panel
8 G, l7 O2 O8 l% c$ _ |'***********************************************************
3 S- H" f% G/ u% ?, m% d2 mPublic Sub draw()
& q$ a0 \' `9 j) {/ G) w& x If dbg_Enabled Then 9 J& Y0 X- z1 y2 {
dbg_FinishTime = Now()
4 M1 B- u- o* o% E# l 9 D+ l* |' A7 b9 n- q9 N# T
Dim DivSet, x
" W; T" a3 d' C9 l Z DivSet = split(dbg_Show_default,",") ( r* a+ e7 ?4 {: Z
dbg_Show = split(dbg_Show,",") / ?+ H* O$ @, i) P9 a" p5 P8 v
; M- l# ^" X( w' p4 e# c( X' r For x = 0 to ubound(dbg_Show)
4 V8 {- o9 M0 p5 }! ]9 b divSet(x) = dbg_Show(x)
# a `5 {' u5 e {) C; a8 C. c6 u Next
- |, }' b$ I( g. F
( f; U$ |9 C( f$ a5 I) i 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>" " G8 w2 y1 D, E1 r# x1 T& d! l
Call PrintSummaryInfo(divSet(0)) - @1 h. J6 f! o1 }* z) ?* g
Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
, R! N2 }- F4 T& a Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
5 C8 G9 Z+ n; Z" t Call PrintCollection("FORM", Request.Form(),divSet(3),"")
: [' ?; \# d/ G }, O( C& k5 T1 o5 d Call PrintCookiesInfo(divSet(4))
) y8 ]2 ^, `6 P: Z 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)) . ~; n. e4 G$ C
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"")
$ |# K/ G, \: x, J' ?$ m Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout)) 0 D# ^6 x7 k+ h; p, R8 Y' _
Call PrintDatabaseInfo(divSet(8)) # |: ^) U( Z! ]+ U% H
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
. T$ i+ E% j2 o3 H' U* ] Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"")
" C8 z/ t$ v& x1 D' b' s7 I Response.Write "</Table>"
, O9 @% a+ D- y9 E End If 0 v1 ]3 U- X( M3 p
End Sub </P>< >'Destructor . B5 _/ @: n* H
Private Sub Class_Terminate() 8 M! S$ {. m: F* s8 l
Set dbg_Data = Nothing ; a- [! ]3 l& ]
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >
( \& G) R3 L3 q0 @0 d! uCLASS debuggingConsole # S7 B+ F! A1 I/ z8 y; {8 z1 @
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false 3 G. g% I9 x' W
&n
1 H) n2 Y, J, Nbsp; ) _ h4 I4 F) }
Property Get Enabled===[bool] Gets the "enabled" value
0 Y: Y6 s$ v0 m; G0 P
+ v% U7 t/ C' O$ nProperty 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 % |) y. I1 [/ F$ s0 m/ ~9 ?
7 V7 J, l+ W/ s& L* Z TProperty Get Show===[string] Gets the debugging panel.
6 Z$ U0 w7 R: a; S* R8 O( z) \5 A. u% U
& _3 Q# w' C0 M9 G8 |1 qProperty 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>< >-------------------------------------------------------------------------------- o) P. q7 ]4 ^- b' m- u o
Public Methods </P>< >public sub===Print (label, output)
2 g N6 ~3 T+ i6 v$ e/ G1 x( j; U* H Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
) J2 ] e* H @; `1 f Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () % q$ W" C$ m( s
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
2 a4 N7 U5 M. j# j; A. zMethods Detail
7 N4 f- }- y2 a- i3 a5 W 4 ]/ R' g! U3 C* Q
public sub===Print (label, output)
0 u, Q& E! Y5 V7 QParameters: H! Y1 N: f9 \1 Y
- label [string]: Description of the variable . h5 a: g; |3 U/ q
- output [variable]: The variable itself : H3 H+ @2 B& f& ?" f
" y" y! C% M, Y d1 l
public sub===GrabDatabaseInfo (byval oSQLDB) 6 m" P# {" s0 I6 Q
Parameters:
* k# o* o4 }9 i4 i - oSQLDB [object]: connection-object</P> |
|