一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

asp 批量删除指定文件代码

时间:2022-06-29 14:26:59 编辑:袖梨 来源:一聚教程网

DelImg="a.jpg,b.jpg,b.jpg"
              img=Split(DelImg,",")
              Set FSO=Server.CreateObject("Scripting.FileSystemObject")
              For i = 0 To Ubound(img)
              ''开始执行删除
              DeleteFile = Server.MapPath(img)
                     on Error Resume Next
                     FSO.DeleteFile DeleteFile, True '强制删除只读文件
                     If Err.Number = 53 Then
                     Response.Write DeleteFile & "文件不存在!"
                     Response.End
                     Elseif Err.Number = 70 Then
                     Response.Write DeleteFile & "文件属性为锁定状态!"
                     Response.End
                     Elseif Err.Number <> 0 Then
                     Response.Write "未知错误,错误编码:" & Err.Number
                     Response.End
                     End If'删除结束==============================
              Next
     %>

热门栏目