日期:2010-08-26  浏览次数:20902 次

'程序名:delfile.asp
'关键参数:struploadfiles 文件名称
例:<a href="/delfile.asp?action=test.rar">删除test.rar文件</a>

<%
struploadfiles=trim(request.querystring("struploadfiles"))
action=trim(request.querystring("action"))
response.write "成功删除<font color=red>"&struploadfiles&"</font>文件!"
call delfiles(struploadfiles & "")
sub delfiles(struploadfiles)
if struploadfiles="" then exit sub
dim fso,arruploadfiles,i
set fso = createobject("scripting.filesystemobject")
fso.deletefile(server.mappath("" & struploadfiles))
set fso = nothing
response.write"<script language=javascript>alert('成功删除文件,将返回上一页!');"
response.write"this.location.href='javascript:history.back();'</script>"
end sub
%>