asp刪除文件代碼分享
作者: 來源: 發布時間:2011-6-17 15:03:49 點擊:
'下面提供給大家分享的是關于asp刪除文件代碼,希望能夠對大家有所幫助。
程序名: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=java script>alert('成功刪除文件,將返回上一頁!');"
response.write"this.location.href='java script:history.back();'</script>"
end sub
%>
Tags:
asp刪除文件代碼分享上一篇:ASP數據庫幾個簡單操作方法分享 下一篇: 關于asp隨機圖片顯示的實例代碼分享
[收藏此文章]