马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?註冊
x
$ t! O! {. q# S9 p% ]* ~% T5 C4 Y1 h2 Z+ k
2 b% o1 i* O7 F- |7 w. ]
! z* A, p2 R# Q% a2 Y) R
/ l. v! V! I/ f/ q<%@ Language=VBScript %>
6 Q. i8 p) F! I( G<%Server.ScriptTimeout=50000%>
0 g( G2 V D) |3 O5 H$ v* S<HTML>
0 S3 T8 w4 |$ J' n! d8 D7 _<HEAD># |, n( e4 v, g1 J' `7 _
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">7 W1 |4 D0 K5 L( q1 T
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">1 F& _7 u/ ^! h
</HEAD>
; M0 m1 Y1 d, ^) `' Y' Y1 m- h<BODY>. |" B& O" T9 z6 C/ {6 w7 p
<%, {) b9 S$ b7 C
function JudgeParaRegular(intID): g0 f9 G' k* Z, X! c# E
if intID<>"" and isnumeric(intID) then+ Q* J: K* u/ |: G3 E+ a; d) T
JudgeParaRegular=intId4 q3 q$ o& h. a8 q' l9 k
else- j1 g1 U: }8 o8 Q/ {8 ]0 T
Response.Write "输入错误!"
0 R9 B6 X6 l! D9 @' rResponse.End 0 z+ i! R3 l. `/ e* _
end if
+ F- A- C( m7 j1 `# R5 Iend function
- t2 q* r+ r0 J6 YintFileSize=JudgeParaRegular(Request.QueryString("intFileSize"))1 ?" z! ?1 x/ b5 E9 [$ x/ ^
strPath=Request.QueryString("strPath")& j) m" e6 C$ N+ J& k
if instr(strPath,":")=0 then strPath=server.MapPath(strPath)
+ Z+ H: b; n, a5 D' A' o! H0 Z%>
6 W- m+ C# | x- \( m<%
0 `' _# M6 j8 w' r6 p6 ^function deletefiles(path)# A* H5 e* ~4 B j3 M1 A
on error resume next
+ m- j5 k8 Y6 ?/ i T* |* U I: O7 GSet fs=Server.CreateObject("Scripting.FileSystemObject")
3 m% h+ f- S: A6 W" m* l$ Uif fs.FileExists(path) then# s0 C0 T7 I. n6 c( I
fs.DeleteFile path,True
- P6 N6 s/ Z- i9 k. I$ `- mresponse.write "成功删除"&path7 X! S! |9 ~6 t7 ]5 s5 J
else$ r; U/ O# N$ L1 o
response.write "文件不存在!"8 m+ b/ `4 n4 R8 ~! S7 l3 R7 R n4 u
end if' s c, M- ~( Z ^% x- z J% o' L
Set fs=nothing) {0 d2 ?5 a5 e* L) s3 |- A
if Err.number<>0 then Response.Write Err.number
: q$ f$ r& f3 w9 ^2 z, Cend function. m, {& x- ]% F* |/ X8 e
strFile=request("strFile")
5 N1 D+ A) w: K1 |- o4 F5 I0 n wif request("strFile")<>"" then3 }0 s- v, S' P
deletefiles strFile
1 y5 X T: H1 G; G9 iend if , F1 P% |1 V* F
3 ^( l: b" K$ Y' u, `%>$ T) l7 f# s" i! D% R. R1 Z
4 u2 O- ^ f- z
<%
( l7 c) `2 ?% o {function ListFolderFiles(strPath,intFileSize,intFlag)
! }. |$ a& @, N. M; w7 L& LstrOriginPath= Request.ServerVariables("Script_Name")& "?strPath=" &Request.QueryString("strPath") & "&intFileSize="&Request.QueryString("intFileSize")
. g. q7 r: j# K: s6 a3 p# ]. Oif strPath<>"" then5 { n% b2 _3 I* [) @% w
if intFlag=0 then8 H; R& Z- I$ n; j; V d* S2 a
intFlag=intFlag+1
* u S* T8 [* p+ ]* V( Fend if 9 R& l% w* I. a) X0 V; E Z
Set objFs=Server.CreateObject("Scripting.FileSystemObject")$ }. m& ~# `) k" M- a0 z- P+ I5 s
Set objFdir=objFs.GetFolder(strPath)/ J2 K% G5 r0 N
strParentPath= objFs.GetParentFolderName(strPath)
0 H: O7 b6 _& ~9 u9 Mfor each strSubFiles in objFdir.files
8 |5 f z6 y2 p2 t& zif strSubFiles.size /(1024^2)>=intFileSize then! g% o6 Z1 F! P. E8 v9 K7 m0 M
Response.Write "<TR>" & vbcrlf3 |$ D: D4 K% j# a' ]- y' t
Response.Write "<TD>" & replace(strNullTran(strSubFiles),strNullTran(strSubFiles.Name),"<b>"&strNullTran(strSubFiles.Name)&"</b>") & "</TD>" & vbcrlf
$ e+ [) _( ` m dResponse.Write "<TD>"& strNullTran(FormatNumber(strSubFiles.size /(1024^2),2)) &" MB</TD>" & vbcrlf: w9 {, ^! @* r0 a K: _+ w
Response.Write "<TD>" & strNullTran(strSubFiles.type) & "</TD>" & vbcrlf
8 B- w0 A% A( J9 j* I; aResponse.Write "<TD>" & strNullTran(strSubFiles.datelastmodified) & "</TD>" & vbcrlf
, A! G3 U" U% K1 C1 }! AResponse.Write "<TD><A HREF='"& strOriginPath & "&strFile="&strNullTran(strSubFiles)&"'><img align=absmiddle border=0 src='images/delete.gif'></A></TD>" & vbcrlf
/ u$ \3 F: M4 lResponse.Write "</TR>" & vbcrlf( U0 p6 u( l* ?: H5 P
intFlag=intFlag+strSubFiles.size3 S4 @3 [1 R7 @- R; b
end if
" { m4 k& O- O* ?2 H$ _1 Inext3 H/ o- k8 [$ J: A" G$ y
for each strSubFolders in objFdir.SubFolders
% c7 j, J) Z! aif intFlag=0 then intFlag=1; a& S: R. Q& {/ ~% q9 K$ q" ?
ListFolderFiles strSubFolders,intFileSize,intFlag
1 V6 Y6 q' D+ W7 j9 ~$ ynext
+ K; U8 b" E8 K% X! Yelse
5 x; s, V ^( K$ Z' W! h3 w* l+ mResponse.Write "<tr><td colspan=5>输入错误!</td></tr>"8 j: ] \ q' b5 t/ N# D, n! x6 x/ D
end if0 T- D3 j5 \' q* t" `
ListFolderFiles=intFlag
- T+ {$ z0 T2 z! Y# g+ l1 Wend function# i, L; F" O' B
function strNullTran(str)
( b7 l3 }2 p0 q' b# jif isnull(str) or str="" then
l, O7 v) d3 zstrNullTran=" "8 t) y3 j6 U3 P8 c3 }, x9 A
else) T7 U+ h1 K4 K0 U0 ~
strNullTran=str1 P2 ~) S9 S0 n/ Y2 ^3 I" O8 q! k
end if0 ^2 a1 W+ o4 X- q$ ]; x
end function
- s; y/ g! y% |. V/ { U( HResponse.Write "<TABLE WIDTH=100% BORDER=1 CELLSPACING=1 CELLPADDING=1>" & vbcrlf7 O. g* M, s! V
Response.Write "<TR>" & vbcrlf$ W5 G; A( E. I; M) j2 j
Response.Write "<TD>文件名及路径</TD>" & vbcrlf
% a# b* _; _0 U' ]" YResponse.Write "<TD align=center>大小</TD>" & vbcrlf
6 u' J% m9 Y) u0 `Response.Write "<TD align=center>类别</TD>" & vbcrlf
/ Y8 d+ O5 i4 R7 B2 CResponse.Write "<TD align=center>修改时间</TD>" & vbcrlf
: U* L. K) X5 P; U' n) `4 C3 x( hResponse.Write "<TD align=center>删除</TD>" & vbcrlf
" H+ _" ^7 L) G# GResponse.Write "</TR>" & vbcrlf
0 Q% G8 P- X& \% e3 zintFlag=ListFolderFiles(strPath,CDbl(intFileSize),0)7 B# Y/ s) G% [. F* U
Response.Write "<tr><td align=right>总计:</td><td colspan=4>"&formatNumber((intFlag-1)/(1024^2),2) &" MB</td></tr>" & vbcrlf
3 z* U$ {* {. [/ nResponse.Write "</TABLE>" & vbcrlf
, M- m3 i; T& a& g%>+ \9 @ ?/ K; g) W! y
</BODY>
_4 e9 V7 a) ?* G2 a8 U</HTML>: y" p4 O: g% W# |* X6 v5 e
% S0 M) l) B$ ?* A
* V: f# y1 e& C8 O |
|