马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?註冊
x
' Y, y, n7 c" d [8 c, t$ p8 N
6 N7 Q! I# }$ E) {8 y X( o' T, S6 K" P3 f
- k) H2 i2 V" l% F9 H3 `9 N8 d2 U
<%@ Language=VBScript %>( M7 f) T' u3 q8 Y4 t5 G* O5 Z* c
<%Server.ScriptTimeout=50000%>+ d) K. G) s: l
<HTML>) G1 s$ a: p4 G
<HEAD>2 T( c2 |; g1 q% ~, O8 q& ]
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">6 E) l" y, x/ ^' J6 {- n5 f7 v
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">; s. A* g6 E1 x7 o L; B
</HEAD>
3 ]. B* T9 g/ h. J<BODY>
. U4 `' O( h0 m9 S- P<%
% A& t- r. E# A9 e# Ifunction JudgeParaRegular(intID)
" I- u8 n# [* Z" ?- ^if intID<>"" and isnumeric(intID) then
- {; E7 s. q& rJudgeParaRegular=intId
1 Z: `; h1 K4 l) yelse& u/ j. _- r( H
Response.Write "输入错误!" " F. A1 A9 A( d7 z; l4 [) f
Response.End . A% m( s! B v: N6 r
end if
Q6 Z9 {& O* @) H9 n1 T2 Z; iend function
j9 n( a) J. e' B6 b, pintFileSize=JudgeParaRegular(Request.QueryString("intFileSize"))' `! J) J s" B
strPath=Request.QueryString("strPath")
) L; j9 Z5 P! y+ N* }if instr(strPath,":")=0 then strPath=server.MapPath(strPath)
9 ^% h6 H9 J2 O1 a0 R" F& u$ ?$ x%>
. d+ R1 c; L: N4 H! L+ Q<%
/ U/ D; c2 d$ t" x H& cfunction deletefiles(path)' b$ P2 U+ M% j" R* C: G. @- R
on error resume next
& V, T* G0 j# J4 dSet fs=Server.CreateObject("Scripting.FileSystemObject")
& q% d+ Z. m6 v" E7 P" \$ z6 \if fs.FileExists(path) then
* z8 G$ |5 u5 [' Ifs.DeleteFile path,True
( f8 @! ?3 h+ Iresponse.write "成功删除"&path' y9 }# i) r- X) [* c
else
J- h2 H* w7 D, ^" w+ aresponse.write "文件不存在!"
( H2 m- X y# q% V2 @1 fend if
# y0 v% v F# lSet fs=nothing
/ c P6 Y' R4 N$ eif Err.number<>0 then Response.Write Err.number
- P: [9 s$ D; O! P! e( Cend function& W! g8 N2 @" A5 v% a
strFile=request("strFile")+ A. ~* I; s: R0 F8 u$ h
if request("strFile")<>"" then2 U7 K' b) H! p' d& Q
deletefiles strFile& m. ^5 g! a$ _
end if
1 v# Q5 Z7 v W) ?7 i* |! E, R( K
( I6 h1 w- q% Z, Z7 k%>
, ]' W6 g; N' H4 L1 P
. ^$ ~, s5 T/ R# g$ }+ d<%
+ J3 t7 d- Z( S, yfunction ListFolderFiles(strPath,intFileSize,intFlag)$ v x% w* Z8 R1 E; a; ]) v) }- m9 ?
strOriginPath= Request.ServerVariables("Script_Name")& "?strPath=" &Request.QueryString("strPath") & "&intFileSize="&Request.QueryString("intFileSize")/ p3 X5 w5 ?8 ?& U% J- w% ?
if strPath<>"" then* F* V; B7 X( i) }
if intFlag=0 then2 O+ a# q! P: j" y; f8 Z
intFlag=intFlag+17 T! ?) W) ?. R$ e6 j6 H' I( Z W
end if
5 M5 L& [0 L3 ]& g/ Q4 O2 oSet objFs=Server.CreateObject("Scripting.FileSystemObject")4 E+ Y* b* y. x' M
Set objFdir=objFs.GetFolder(strPath)
, s+ n. c8 ^$ P- N/ vstrParentPath= objFs.GetParentFolderName(strPath)5 y! @) h' s# [% y) e6 d
for each strSubFiles in objFdir.files; u7 V# r l7 j7 E' Z3 Z
if strSubFiles.size /(1024^2)>=intFileSize then6 D N+ w' Z: [5 U, M' v" C$ n8 V
Response.Write "<TR>" & vbcrlf
8 }) X; p) M. p+ V! S) P1 A7 nResponse.Write "<TD>" & replace(strNullTran(strSubFiles),strNullTran(strSubFiles.Name),"<b>"&strNullTran(strSubFiles.Name)&"</b>") & "</TD>" & vbcrlf
3 e0 C5 [8 ?' C. d7 O3 rResponse.Write "<TD>"& strNullTran(FormatNumber(strSubFiles.size /(1024^2),2)) &" MB</TD>" & vbcrlf" J: T7 |) f$ G+ ~
Response.Write "<TD>" & strNullTran(strSubFiles.type) & "</TD>" & vbcrlf5 i7 b, \9 X5 ~" T
Response.Write "<TD>" & strNullTran(strSubFiles.datelastmodified) & "</TD>" & vbcrlf/ r) d5 q% Z" A- r; S! _6 M7 \
Response.Write "<TD><A HREF='"& strOriginPath & "&strFile="&strNullTran(strSubFiles)&"'><img align=absmiddle border=0 src='images/delete.gif'></A></TD>" & vbcrlf
# _/ x; H4 ^! qResponse.Write "</TR>" & vbcrlf
Q8 R: }" U" U" AintFlag=intFlag+strSubFiles.size+ y d, j) S1 z1 G2 |% ?
end if+ l0 r+ H; a9 ?4 p7 R: `$ b) C; f
next
8 G, t4 j7 K8 o' n1 `for each strSubFolders in objFdir.SubFolders5 Q/ B7 Z! S/ L
if intFlag=0 then intFlag=1
; S' ]( R0 T8 v! m- hListFolderFiles strSubFolders,intFileSize,intFlag
9 {( y8 X- t9 u: c$ z* K) tnext' p* \0 u l9 I3 T7 n
else
& X$ Y8 k* c3 O; SResponse.Write "<tr><td colspan=5>输入错误!</td></tr>"3 w3 p8 }9 r w. j. g. p G W/ J
end if
) h. @' p# Z3 C- ]0 K% UListFolderFiles=intFlag; f' k) v5 c# N: _% s8 w
end function8 w% X3 R* K0 `) @# R- a
function strNullTran(str)! s9 k1 d" v; V
if isnull(str) or str="" then
' ~6 m3 J. k# U( y. m5 n- gstrNullTran=" ": \, d( {1 H8 K8 r$ S& d( ^( J, F
else
7 A* E& W8 r( Y2 {5 HstrNullTran=str& F6 T) l4 v4 B3 s3 d; {8 \
end if
" D: K9 T9 k- j' K. I) Uend function
# \- m5 k3 X! H8 V& g; fResponse.Write "<TABLE WIDTH=100% BORDER=1 CELLSPACING=1 CELLPADDING=1>" & vbcrlf
" M/ g; m( c5 HResponse.Write "<TR>" & vbcrlf
8 L) G% ~# p( WResponse.Write "<TD>文件名及路径</TD>" & vbcrlf& j7 c9 W5 F3 D1 u" ~' k
Response.Write "<TD align=center>大小</TD>" & vbcrlf$ w* D4 X/ M3 X ?3 E( z0 D
Response.Write "<TD align=center>类别</TD>" & vbcrlf
. [( K- F# s8 WResponse.Write "<TD align=center>修改时间</TD>" & vbcrlf
- x9 m* |+ Y, t- F5 d; T7 qResponse.Write "<TD align=center>删除</TD>" & vbcrlf
& ^' |2 @. n/ v jResponse.Write "</TR>" & vbcrlf: @& B, B( _ l/ j" o, R
intFlag=ListFolderFiles(strPath,CDbl(intFileSize),0)
0 c5 j6 ]5 v% h5 gResponse.Write "<tr><td align=right>总计:</td><td colspan=4>"&formatNumber((intFlag-1)/(1024^2),2) &" MB</td></tr>" & vbcrlf2 H$ n$ C# ]3 M7 O
Response.Write "</TABLE>" & vbcrlf
% g( M9 w; X! y%>* ^) x) D0 n7 `" L U1 u
</BODY>+ }" M) B% `% G [, w
</HTML>
7 ` g \3 b" t. T/ p( Y R) E/ J- b
/ g7 g5 u; r& |% L0 ?
|
|