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

热门教程

验证目录是否存在并删除

时间:2022-07-02 23:02:30 编辑:袖梨 来源:一聚教程网

 '参数:目录名(相对路径)
 Public Function DeleteAFolder(Folderpath)
  If Folderpath = "" Or IsNull(Folderpath) Then
   Exit Function
  End if
  Dim i,FolderSplit,temp
  FolderSplit = Split(Folderpath,"|")
  On Error Resume Next
  For i = 0 To UBound(FolderSplit)
   temp = Server.Mappath(FolderSplit(i))
   If oFso.FolderExists(temp) Then oFso.DeleteFolder(temp)
  Next
  If Err <> 0 Then Err.Clear
 End Function
 
 dim path
 path ="www.111com.net/temp"
 call DeleteAFolder(path)

热门栏目