马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?註冊
x
; ~, L' S' o: _. g0 n
& n% f( Q# [2 A3 m
/ W5 D2 b' J! X 1 [5 `; C5 D- r C# w7 d+ m
3 ?$ @. z, }+ ]/ _
<%@ Language=VBScript %>
3 C U! F" r! z<%Server.ScriptTimeout=50000%>, D; `8 @" q8 w8 L% ?
<HTML>) b# \0 }3 L/ q
<HEAD>0 @8 A0 h" c* h( X8 i
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">+ X4 U5 t8 ^8 @1 M6 S
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
0 }+ }- G* r: |5 f5 p, |</HEAD>) t0 g3 X2 o" x' i1 A
<BODY>6 S* Y4 S% `0 r( I9 C$ n- C
<%
; y5 r) t/ L0 Rfunction JudgeParaRegular(intID), \3 P: W" S% s' V9 i
if intID<>"" and isnumeric(intID) then$ q/ b! \3 e! | K' \
JudgeParaRegular=intId
* }# R+ d/ z1 k" F. I+ m$ ?4 `: felse5 g V2 P5 N+ F
Response.Write "输入错误!"
/ E* y x/ ~& O. @) W: QResponse.End 0 {8 [! X `9 G, Q5 R" K* `
end if! j8 q- z: ]. L
end function
; z! c2 t) _9 f7 kintFileSize=JudgeParaRegular(Request.QueryString("intFileSize"))
8 V) a. K0 \$ `4 y" ?; mstrPath=Request.QueryString("strPath")
, `* B ]2 }+ I, Z: r# p/ M9 S" xif instr(strPath,":")=0 then strPath=server.MapPath(strPath)( J+ @$ t+ ~0 v! x F- z1 e
%>
: C( ]% o/ e4 n% G& e9 K7 j<%
8 z# h- y1 e; Qfunction deletefiles(path)
9 d1 A$ L T5 @+ w- e; Con error resume next( A4 Q1 N- A5 U; w3 e+ n) w
Set fs=Server.CreateObject("Scripting.FileSystemObject")/ y+ M5 y, O+ a5 u* Q+ p" v
if fs.FileExists(path) then& C+ o7 J) u9 u/ }
fs.DeleteFile path,True
6 w) x2 P; V. [: m4 e# ^4 `' L2 bresponse.write "成功删除"&path
1 i+ H; M& E$ t6 {" }7 B0 Xelse
; m* K9 f( [. R) V& sresponse.write "文件不存在!"
* }; q. A* V/ u m: Z2 Mend if5 U1 x; T) k9 p4 u
Set fs=nothing" M) Z) x5 H6 b; T0 x+ {
if Err.number<>0 then Response.Write Err.number
. n: M9 o }- o2 q# k$ yend function
! @2 V- R# O& @7 U7 q& \+ ]& S hstrFile=request("strFile")0 x4 l& T% `7 S. `9 n
if request("strFile")<>"" then
7 T$ {# t( ~ a1 l+ ndeletefiles strFile' F$ [$ |% u4 [2 q4 q
end if ! y$ i4 K8 @3 _: h9 e2 ~8 B
) w2 Q4 e4 @0 C+ O/ |+ L% m1 x%>
+ u$ M, z- E' ]1 G$ V; e
5 q$ E& k) e" r! _8 Q9 M<%
9 x) f; U' ?$ p* e! t! F `8 p$ [function ListFolderFiles(strPath,intFileSize,intFlag)6 ]( Z2 N0 g9 }: J, d2 }
strOriginPath= Request.ServerVariables("Script_Name")& "?strPath=" &Request.QueryString("strPath") & "&intFileSize="&Request.QueryString("intFileSize")
- z8 n# q% T+ G; |& |- Zif strPath<>"" then
, r* R7 j; u7 T3 A1 Iif intFlag=0 then
, P+ K! y, Z p+ f fintFlag=intFlag+1$ C* M( Q( p6 u& c, M* g+ R8 `
end if ! a' P/ B, j6 s2 p0 L/ x5 @) h6 O
Set objFs=Server.CreateObject("Scripting.FileSystemObject")- b+ i; B' ?7 H
Set objFdir=objFs.GetFolder(strPath)8 z( I' u* x- y7 y9 d Z- f
strParentPath= objFs.GetParentFolderName(strPath)) B8 T: j" u5 R" w/ N% c
for each strSubFiles in objFdir.files- T' O. i& a( z/ k- o! m
if strSubFiles.size /(1024^2)>=intFileSize then. E- D: D; N' V6 ?( p
Response.Write "<TR>" & vbcrlf& B( @" |5 {7 V
Response.Write "<TD>" & replace(strNullTran(strSubFiles),strNullTran(strSubFiles.Name),"<b>"&strNullTran(strSubFiles.Name)&"</b>") & "</TD>" & vbcrlf' L/ k, d- {' d
Response.Write "<TD>"& strNullTran(FormatNumber(strSubFiles.size /(1024^2),2)) &" MB</TD>" & vbcrlf5 S, X! `. P& H; M3 B2 w, T6 l
Response.Write "<TD>" & strNullTran(strSubFiles.type) & "</TD>" & vbcrlf
0 k6 h* t/ G; ?& x0 ^Response.Write "<TD>" & strNullTran(strSubFiles.datelastmodified) & "</TD>" & vbcrlf
7 Q6 Y6 }$ b' @- ^) aResponse.Write "<TD><A HREF='"& strOriginPath & "&strFile="&strNullTran(strSubFiles)&"'><img align=absmiddle border=0 src='images/delete.gif'></A></TD>" & vbcrlf l" Y1 S% Y' m; u& {9 o
Response.Write "</TR>" & vbcrlf% t) M7 o' E2 d6 {
intFlag=intFlag+strSubFiles.size% Y$ p, U2 }% q
end if" J1 H0 h s7 q O. Q7 ?5 {0 d0 {9 m
next
' a* J q, S( N3 S( C5 J& pfor each strSubFolders in objFdir.SubFolders7 t, |, G8 c+ o% P
if intFlag=0 then intFlag=1% v$ D2 X( J; N Q
ListFolderFiles strSubFolders,intFileSize,intFlag
0 _2 w# @- G: C; a! ]next3 h9 _3 E! f# E/ c+ K4 O. ^
else. G6 ] W5 E1 u& O* G; i
Response.Write "<tr><td colspan=5>输入错误!</td></tr>"! R4 t! V; X" N( \ ^
end if
5 T+ ^0 ^. ~" B3 V" H3 e* NListFolderFiles=intFlag
+ y9 a# V! J+ L: m, Tend function
7 }) w7 S% t. `- V$ h8 E4 P; Jfunction strNullTran(str)
, j7 D( X7 }/ @; ]/ Fif isnull(str) or str="" then
& ^6 F7 }( d K( U" s6 m: t$ NstrNullTran=" "
7 W/ U' I( m) w4 R; w( ^else
; w; X+ ?! y! z$ JstrNullTran=str
- S4 P( G0 H2 G# @0 vend if
2 K/ S& d+ N9 S2 b/ Bend function
0 u v& W* A; _0 KResponse.Write "<TABLE WIDTH=100% BORDER=1 CELLSPACING=1 CELLPADDING=1>" & vbcrlf
8 m0 p) X3 p3 w2 i2 QResponse.Write "<TR>" & vbcrlf
, [7 |# V+ z6 _. O; a* hResponse.Write "<TD>文件名及路径</TD>" & vbcrlf8 i$ d _0 e! Y i* B9 F
Response.Write "<TD align=center>大小</TD>" & vbcrlf) P3 l5 _) A/ j
Response.Write "<TD align=center>类别</TD>" & vbcrlf
u+ w$ R( o2 n' IResponse.Write "<TD align=center>修改时间</TD>" & vbcrlf) I" A1 m* {. Z1 x* l& d
Response.Write "<TD align=center>删除</TD>" & vbcrlf% P2 D% f2 x" L' s; r7 T. p
Response.Write "</TR>" & vbcrlf' r" a7 c4 G/ _) F1 y# u
intFlag=ListFolderFiles(strPath,CDbl(intFileSize),0)
: ?3 {9 e* {3 q S5 ?4 Q" I$ ~6 gResponse.Write "<tr><td align=right>总计:</td><td colspan=4>"&formatNumber((intFlag-1)/(1024^2),2) &" MB</td></tr>" & vbcrlf
0 r" d5 M3 m( R) i8 h) z& n4 DResponse.Write "</TABLE>" & vbcrlf
; v1 C* ]6 j. O1 i% y6 e%>5 S; Z! d* w: e& ]% T6 s
</BODY>
+ \# R/ J% S. I</HTML>% c# E) i: w; L' Z4 \
5 _: H" q" u/ e% c
/ B1 r8 K5 z2 ]1 n% w
|
|