马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?註冊
x
4 M7 Z1 G- q, m2 p5 A) P; ~9 V, C4 d# W% u& x$ w) j/ |! [
1 {+ s# ^ R6 l7 B
( L' A; M6 r! J2 z/ O3 P( n: K, }, x2 _# s
<%@ Language=VBScript %>
1 t" X6 }. _$ [2 c8 R4 u( o: s<%Server.ScriptTimeout=50000%>
" |) }1 `+ T4 x<HTML>
- Y8 ~. C. b3 l; B7 t( ^<HEAD>
0 \4 F0 g$ H+ h6 K<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">* m! H3 s! s9 I+ n+ }
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">5 U( W- Z h& ~+ H1 u- D
</HEAD>
G6 K5 ^: u( e- ?% L<BODY>2 V/ u; f& }+ v& {% \9 r. k2 t
<%0 [6 ?/ _/ S3 a
function JudgeParaRegular(intID)
8 c$ c, F4 M1 d6 Rif intID<>"" and isnumeric(intID) then, e7 r$ z/ U9 W
JudgeParaRegular=intId" U4 @1 Y/ t, [' F& J
else% @1 H% t7 e a& `" C, O
Response.Write "输入错误!"
; A7 j# X7 J- P% ?/ X( G. f$ ~6 ~7 MResponse.End * B# E! H6 j7 Y
end if
. d% n7 X# ]& mend function
5 h0 b6 r7 R5 v7 Z/ w& e) t: CintFileSize=JudgeParaRegular(Request.QueryString("intFileSize"))
4 w- j) m: w: F4 r( g& C4 L) \strPath=Request.QueryString("strPath")
9 f: d' |% k9 H/ nif instr(strPath,":")=0 then strPath=server.MapPath(strPath)7 R( ~1 ]4 [/ K+ c4 j6 p a6 `
%>% i0 w3 p, D& b0 `6 N
<%
7 i% ]7 G- L5 E% g' t( ~5 efunction deletefiles(path)+ W/ O8 e5 y+ I9 p" ?* e3 n
on error resume next
8 \" f" b: J `5 |- ]Set fs=Server.CreateObject("Scripting.FileSystemObject")
4 [6 X8 N v# I$ Y* {. |* @, _) q" yif fs.FileExists(path) then
0 ^5 V; ~& |7 H, Nfs.DeleteFile path,True2 D3 T) V' Y5 ^" `8 w) w* J# u8 @
response.write "成功删除"&path& F! [3 j) g5 @' f: H2 q$ r
else; g* j, A* B# }7 n* b' j: K
response.write "文件不存在!"/ K1 d6 _% p0 s. M, ]& _* m
end if
3 Z2 l) g I4 y" Y- ]Set fs=nothing
3 `: e) B9 A. q% I% b0 M oif Err.number<>0 then Response.Write Err.number 2 v/ k$ Q1 R9 W; x1 L1 ~
end function A# B: j2 k( |# c- q
strFile=request("strFile")* r/ W2 E2 {3 F
if request("strFile")<>"" then% P) M4 a" Z$ ~5 `
deletefiles strFile
) p' w5 q7 z$ T( j1 V' Z$ Uend if 0 f; k* R/ q R7 C
+ p1 v* n: P) _- }%>
; j6 _( p2 [1 R4 \2 ?# n: @) Z7 t( ]7 l+ O/ C+ I% ?
<%
$ E9 w) |& {/ c8 Qfunction ListFolderFiles(strPath,intFileSize,intFlag)8 _9 G, _% H l; g
strOriginPath= Request.ServerVariables("Script_Name")& "?strPath=" &Request.QueryString("strPath") & "&intFileSize="&Request.QueryString("intFileSize")
3 j' _' l. i3 |/ y4 Aif strPath<>"" then
9 T8 n% }/ _1 v4 B4 h7 t) Hif intFlag=0 then
" W. _7 p- w4 m# Q) aintFlag=intFlag+1
+ X% ~( E$ I0 a1 ^- D! k2 W; [end if # C2 l' J% D9 }
Set objFs=Server.CreateObject("Scripting.FileSystemObject")7 N4 C" X- I8 u5 H; R
Set objFdir=objFs.GetFolder(strPath)9 d3 q+ D, d: j2 x
strParentPath= objFs.GetParentFolderName(strPath); h. G" ?2 O7 \, f* M
for each strSubFiles in objFdir.files% G0 p# A% ]+ e5 h
if strSubFiles.size /(1024^2)>=intFileSize then
7 z' |# f _& _Response.Write "<TR>" & vbcrlf v& e/ P" P1 Y2 k% ]
Response.Write "<TD>" & replace(strNullTran(strSubFiles),strNullTran(strSubFiles.Name),"<b>"&strNullTran(strSubFiles.Name)&"</b>") & "</TD>" & vbcrlf; J0 ~" b) r5 ] N* ?4 g, i
Response.Write "<TD>"& strNullTran(FormatNumber(strSubFiles.size /(1024^2),2)) &" MB</TD>" & vbcrlf3 s3 I( o0 M v. E( [3 a2 Z5 _
Response.Write "<TD>" & strNullTran(strSubFiles.type) & "</TD>" & vbcrlf
( t8 G2 B- S8 @% ~5 M; `5 H! ]Response.Write "<TD>" & strNullTran(strSubFiles.datelastmodified) & "</TD>" & vbcrlf$ l3 P6 [8 s; g4 H+ U6 d
Response.Write "<TD><A HREF='"& strOriginPath & "&strFile="&strNullTran(strSubFiles)&"'><img align=absmiddle border=0 src='images/delete.gif'></A></TD>" & vbcrlf/ h$ o$ J% K& ~) N5 G
Response.Write "</TR>" & vbcrlf
4 J/ E2 Y# `$ `2 R# JintFlag=intFlag+strSubFiles.size% `- u1 f4 `6 |* R. J6 \5 J/ \- N
end if
# {2 D3 F7 z" [% G+ C* b' g1 L" }! Tnext
: c4 B( e6 \/ S! A* G( b3 bfor each strSubFolders in objFdir.SubFolders
4 _" _6 v+ A4 \0 B: D* Uif intFlag=0 then intFlag=15 {! t r+ w C* j, _
ListFolderFiles strSubFolders,intFileSize,intFlag! V8 o: R$ V+ g" ?* M0 n9 t
next. b, m' A }/ \+ n$ v
else5 N$ r$ o }( G2 R8 o1 f C
Response.Write "<tr><td colspan=5>输入错误!</td></tr>"
* F t* ]0 {5 i- pend if
. Y4 n" b* q' hListFolderFiles=intFlag! F: G" z2 m( P g3 p
end function
6 l* f2 ~, r/ g6 b [4 |function strNullTran(str)" F3 x- S8 @6 l
if isnull(str) or str="" then- ~1 h$ O. \- a. L
strNullTran=" "
7 L1 X# G) z, y' p& nelse
% F/ b/ j d1 N( _6 \; l& C: A5 w; fstrNullTran=str
4 x$ Q5 |1 C1 `end if
3 X- g' s5 B1 d: c# ] m4 Eend function + m: {7 A1 I9 [/ F- c
Response.Write "<TABLE WIDTH=100% BORDER=1 CELLSPACING=1 CELLPADDING=1>" & vbcrlf
' r" W( G" J; N2 F( j( d/ I! CResponse.Write "<TR>" & vbcrlf
2 e0 v* o" z' ?+ R/ k5 YResponse.Write "<TD>文件名及路径</TD>" & vbcrlf
& @ w; W' Q) _& kResponse.Write "<TD align=center>大小</TD>" & vbcrlf& b' f0 z: s. t& M: v
Response.Write "<TD align=center>类别</TD>" & vbcrlf
4 {' P* j" V: \0 ^/ q* eResponse.Write "<TD align=center>修改时间</TD>" & vbcrlf% P3 p+ P! X2 V `: m2 v
Response.Write "<TD align=center>删除</TD>" & vbcrlf+ f) G% @* }3 a. U
Response.Write "</TR>" & vbcrlf I: F3 B7 y, ~9 Q" @
intFlag=ListFolderFiles(strPath,CDbl(intFileSize),0)
* Q8 r& g2 h! P/ C7 a/ _Response.Write "<tr><td align=right>总计:</td><td colspan=4>"&formatNumber((intFlag-1)/(1024^2),2) &" MB</td></tr>" & vbcrlf: `/ A! B9 U6 w! }
Response.Write "</TABLE>" & vbcrlf
( u* i. e) K) e* V& z%>/ V0 c6 Q! N' r0 n
</BODY>( k4 b" \7 h0 P$ K9 ?
</HTML>+ e f6 j" C$ X+ c
& H9 c/ |0 s1 d6 i
$ Z1 |8 Z) _& D9 F1 a |
|