最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
删除文件或文件夹
时间:2009-11-03 编辑:简简单单 来源:一聚教程网
删除文件或文件夹
Sub DelAll()
Dim FolderId,FileId,ThisDir,FileNum,FolderNum,FilePath,FolderPath
FolderId = Split(Request.Form("FolderId"),",")
FileId = Split(Request.Form("FileId"),",")
ThisDir = trim(Request.Form("ThisDir"))
FileNum=0
FolderNum=0
If Ubound(FolderId) <> -1 then '删除文件夹
For i = 0 to Ubound(FolderId)
FolderPath = Server.MapPath(UploadFolder) & ThisDir & "" & trim(FolderId(i))
If Fso.FolderExists(FolderPath) then
Fso.DeleteFolder FolderPath,true
FolderNum = FolderNum + 1
End If
Next
End If
If Ubound(FileId) <> -1 then '删除文件
For j = 0 to Ubound(FileId)
FilePath = Server.MapPath(UploadFolder) & ThisDir & "" & trim(FileId(j))
If Fso.FileExists(FilePath) then
Fso.DeleteFile FilePath,true
FileNum = FileNum + 1
End If
Next
End If
Response.write ""
End Sub
-
上一个: asp 文章分页类
-
下一个: asp统计文件空间大小代码
相关文章
- u盘空文件夹怎么删除 07-20
- 怎么快捷删除文件不放入回收站 07-16
- 最右app文件夹如何删除 07-12
- Python如何实现删除文件中含“指定内容”的行 06-12
- WPS如何删除文件中某一页的页眉 06-05
- iOS9描述文件怎么删除?iOS9删除描述文件的方法 02-27