验证目录是否存在并删除

作者:袖梨 2022-07-02

 '参数:目录名(相对路径)
 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)

相关文章

精彩推荐