Niveau
..........
En rapport...

créer un dossier

Cette fonction permet de créer un nouveau dossier.
Elle comporte 1 paramètre :

asp
'Efface les dossier vides
   Function DelEmpty(sRoot) 
      Dim FSO, Folder, SubFolder, File, foldPt, EmptyF
 
	EmptyF = true
      ' Instanciation
      Set FSO = Server.CreateObject("Scripting.FileSystemObject") 
 
      ' Instanciation
      set Folder = FSO.getFolder(sRoot) 
 
      for each File in Folder.Files
	EmptyF = false
 
	next
      for each SubFolder in Folder.SubFolders 
         If Right(sRoot,1) <> "\" Then 
	         sRoot = sRoot & "\" 
         End If 
     		EmptyF = false
         Call DelEmpty(sRoot & delem & SubFolder.Name) 
      Next 
 
		if EmptyF = true then
			set foldPt = FSO.GetFolder(sRoot)
			foldPt.Delete
		end if
		set foldPt = Nothing
      Set Folder = Nothing 
      Set FSO = Nothing 
   End Function


06/03/2007 09:25 -

iDo –