- 在线时间
- 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"))
; y7 S5 S' G9 J dbg_DB_Data = AddRow(dbg_DB_Data, " rovider",oSQLDB.Properties(" rovider Name") & " Ver: " & oSQLDB.Properties(" rovider Version"))
' M3 @7 N" S& O* IEnd Sub < >'***********************************************************
- N& Y6 S' }- j" X'* PrintDatabaseInfo 1 b8 u: R1 [" a1 h
'*********************************************************** 1 s. e: ^+ C9 t! }
Private Sub PrintDatabaseInfo(byval DivSetNo) + S2 }4 n& b/ n; S) c
dim tbl 0 R. m" A5 u1 z$ A! `( P* o
tbl = MakeTable(dbg_DB_Data) ! G; r; F: k, H5 `! X. @) W# O; f, j) t3 N
tbl = replace(replace(replace(DivSets(DivSetNo),"#sectname#","DATABASE"),"#title#","DATABASE INFO"),"#data#",tbl) h# U+ T' e, v- l5 \
Response.Write replace(tbl,"|", vbcrlf) |# d+ W1 ], t6 k; a) o. a' R
End Sub </P>< >'*********************************************************** : C7 F- p1 k+ m A4 w6 @/ i( `
'* PrintCollection
0 p1 i3 K2 x2 }" ]$ x'***********************************************************
" R% g v* L" B$ ~( H9 f9 IPrivate Sub PrintCollection(Byval Name, ByVal Collection, ByVal DivSetNo, ByVal ExtraInfo) , L+ S5 @) U8 ?# h, c \" |7 P( b
Dim vItem, tbl, Temp
7 z$ `5 E: o0 c( R$ H For Each vItem In Collection - E" @6 a. Z, g; @4 W" ^4 V2 c+ }
if isobject(Collection(vItem)) and Name <> "SERVER VARIABLES" and Name <> "QUERYSTRING" and Name <> "FORM" then ' ^9 X/ i* E* _5 v& C1 B Y3 ?
tbl = AddRow(tbl, vItem, "{object}") ( |! T( h+ X! Y* r) ?; B
elseif isnull(Collection(vItem)) then $ V* u# o; _' ]( n
tbl = AddRow(tbl, vItem, "{null}")
( A( C: l- p `( {. h( x! A2 F elseif isarray(Collection(vItem)) then % c( D9 u: C" \+ Y
tbl = AddRow(tbl, vItem, "{array}")
i; `8 ^8 E0 N9 R* j( V else
" T$ T8 S, L! b' z+ p& ^ if dbg_AllVars then ! j' z0 V8 M4 P9 ]: h I
tbl = AddRow(tbl, "<nobr>" & vItem & "</nobr>", server.HTMLEncode(Collection(vItem)))
) S2 ~( Z) l: h* g) b elseif (Name = "SERVER VARIABLES" and vItem <> "ALL_HTTP" and vItem <> "ALL_RAW") or Name <> "SERVER VARIABLES" then " d7 Q r2 F: P4 _- M$ l
if Collection(vItem) <> "" then + z1 g; m6 i4 x8 P6 }8 }5 |
tbl = AddRow(tbl, vItem, server.HTML2 K! B0 s9 K E9 V2 x
Encode(Collection(vItem))) ' & " {" & TypeName(Collection(vItem)) & "}")
$ u `" O6 g4 j else ( D! E, z/ n2 ]1 X. A! f3 o
tbl = AddRow(tbl, vItem, "...")
' \2 d7 L2 h/ G+ `/ t. y end if 2 F% B8 V9 }2 z) J9 f- W
end if
/ W" J# ? t3 f& M4 `2 m+ E end if ; M2 [, u( a$ E2 m
Next
" z4 K9 ?& O$ }' C/ m# V if ExtraInfo <> "" then tbl = tbl & "<TR><TD COLSPAN=2><HR></TR>" & ExtraInfo
% a: @- i; T& x3 V# p0 I! D) J tbl = MakeTable(tbl)
# ]4 F: k1 C6 M8 z if Collection.count <= 0 then DivSetNo =2
$ c6 `$ y3 f/ ]; u& w tbl = replace(replace(DivSets(DivSetNo),"#title#",Name),"#data#",tbl) ; y. j$ J# l+ G4 ^5 B& D( ?
tbl = replace(tbl,"#sectname#",replace(Name," ",""))
7 U/ Q7 q6 U+ D& |. [$ X u Response.Write replace(tbl,"|", vbcrlf)
7 o9 c' m' N! O6 A) wEnd Sub * V2 M+ H3 c4 \6 @( F5 |& W
0 C, [3 w# A/ n8 Y1 g2 `- K* C
'*********************************************************** ( p5 X* ^ P- g2 }# Z& v7 U
'* AddRow
( O$ A. I, c+ C- R1 @" k'*********************************************************** 1 y, \4 x' w( i5 |% Y$ f6 u
Private Function AddRow(byval t, byval var, byval val)
0 G2 Y2 h. I4 I. {+ {9 r5 u t = t & "|<TR valign=top>|<TD>|" & var & "|<TD>= " & val & "|</TR>"
6 F1 |% V; o! L: g7 J& D AddRow = t
( b# h2 |8 ^7 S5 gEnd Function </P>< >'***********************************************************
. Z& U) F+ p/ k- W# g'* MakeTable
/ F6 K2 A: d7 z' \7 a! @'***********************************************************
9 a/ J O% S& F1 x) o VPrivate Function MakeTable(byval tdata) 1 {* a z- j0 q' o
tdata = "|<table border=0 style=""font-size:10pt;font-weight:normal;"">" + tdata + "</Table>|"
7 O, ~% T. r" k0 b: ^$ T/ U- X MakeTable = tdata
$ d9 L! e* X! y& AEnd Function </P>< >'*********************************************************** , k8 ^: Q/ ^; D. l
''@SDESCRIPTION: Draws the Debug-panel ( N# Q+ K6 [8 j8 K8 E% A7 K# N
'***********************************************************
% }7 ]8 q4 \8 G3 W. i* m# hPublic Sub draw()
7 e: F" W1 [! B9 U* X7 x' Q If dbg_Enabled Then
& r% O$ s2 H5 r6 W. B% |3 V: C1 N* G4 B dbg_FinishTime = Now()
* d* b2 S% c( P$ y* c
1 _. I' }" `' O: D" d4 a Dim DivSet, x " T! h& b# o8 @+ p
DivSet = split(dbg_Show_default,",")
/ K+ f4 N h [- V: V- e' m dbg_Show = split(dbg_Show,",") # k& b: G& M( J: a
, b/ M0 p2 s1 f# l For x = 0 to ubound(dbg_Show) % d2 ?' P+ ?4 H2 E% R
divSet(x) = dbg_Show(x)
. D* e, a: V6 C K Next # ]* K) d6 g! \9 D/ b
1 X# O) B ^- J2 X( `+ M 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>"
& x2 b$ v' A/ ~- l* c4 c2 J Call PrintSummaryInfo(divSet(0))
5 Q! n+ ~! w8 K6 w# Z! l% H Call PrintCollection("VARIABLES", dbg_Data,divSet(1),"")
6 j2 g" A) x' x7 x1 l& `- y! V8 H Call PrintCollection("QUERYSTRING", Request.QueryString(), divSet(2),"")
. Q& w8 I) O7 S$ B5 P2 c Call PrintCollection("FORM", Request.Form(),divSet(3),"")
; ]8 M7 d9 V# c9 n Call PrintCookiesInfo(divSet(4))
: W3 [# B- z# d) a 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)) 0 j4 G1 B% i" p5 g
Call PrintCollection("APPLICATION", Application.Contents(),divSet(6),"") 9 W9 C \( r# s8 L# U
Call PrintCollection("SERVER VARIABLES", Request.ServerVariables(),divSet(7),AddRow("","Timeout",Server.ScriptTimeout))
4 @% ^' i7 i1 `7 p9 X5 G$ D3 r3 c Call PrintDatabaseInfo(divSet(8)) ' d9 h) W# U; |5 T0 R4 f# D
Call PrintCollection("SESSION STATIC OBJECTS", Session.StaticObjects(),divSet(9),"")
% O& w$ w t3 R2 v Call PrintCollection("APPLICATION STATIC OBJECTS", Application.StaticObjects(),divSet(10),"") " q0 R, O' {9 t+ w5 L* K9 W- g
Response.Write "</Table>" * O7 \' ?5 _. _( F; X: } R8 w! I
End If 3 k8 f! |0 U( E
End Sub </P>< >'Destructor
5 ?( [$ `* D2 o7 ]% mPrivate Sub Class_Terminate()
* Z$ T8 D; f! y5 k' {6 o* ~9 W Set dbg_Data = Nothing ; e2 w o+ L2 d+ F6 }) @5 r
End Sub </P>< >End Class </P>< >%> </P>< >类的说明: </P>< >( [$ S2 Q9 T6 m8 n
CLASS debuggingConsole 9 S( W4 n6 m& B) [
Version: 1.2 </P>< >-------------------------------------------------------------------------------- </P>< > ublic Properties </P>< > roperty Let Enabled(bNewValue)===[bool] Sets "enabled" to true or false . y8 [& A4 [! r5 P& C4 ]: j; n
&n
, ^0 Q, _9 I$ G E2 bbsp;
! O2 k8 {$ e C3 z; k( A, zProperty Get Enabled===[bool] Gets the "enabled" value 5 J3 ^4 [; }# x* F1 v9 v5 _
5 l1 L" H0 d, W" K, R0 S6 {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 8 @7 D: t+ x. G! ^
$ D3 K1 n& [, m. }* A
Property Get Show===[string] Gets the debugging panel.
. U7 v/ _0 j3 a$ c1 M- k ' z' E$ ^7 I 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>< >--------------------------------------------------------------------------------
; n- Z' l; E5 N' o# aPublic Methods </P>< >public sub===Print (label, output)
A. s6 }1 B4 y7 A, z Adds a variable to the debug-informations. </P>< >public sub===GrabDatabaseInfo (byval oSQLDB)
: i: x' w* ]5 C& T F% x: d Adds the Database-connection object to the debug-instance. To display Database-information </P>< >public sub===draw () 9 N2 h, l, y0 y, G( l7 N' o
Draws the Debug-panel </P>< >--------------------------------------------------------------------------------
2 q9 t7 k3 H+ T' @2 [Methods Detail ' t0 K4 @& I7 L1 q& t0 R
1 I2 T) i; Q, H. c
public sub===Print (label, output) & m, Y/ c: D& f/ K! \$ r
Parameters: 4 X1 ~2 `& F c9 X! d4 s% T- R* V
- label [string]: Description of the variable
& N4 h0 U4 l+ w) j - output [variable]: The variable itself ( ^( t2 l+ n7 h- p
. P5 o H; I% J- r
public sub===GrabDatabaseInfo (byval oSQLDB) 2 h4 S, X5 x, z5 v7 e' R
Parameters: 9 g' R5 P+ B2 [1 C$ q) W+ T
- oSQLDB [object]: connection-object</P> |
|