Je adresář prázdný ?

Funkce:
Private Declare Function PathIsDirectoryEmpty Lib "shlwapi.dll" _
   Alias "PathIsDirectoryEmptyA" _ 
   (ByVal pszPath As String) As Long 

Private Function IsDirectoryEmpty(ByVal sPath As String) As Boolean 

   'Vrací True pokud je sPath prázdný adresář. 
   'Vrací False pokud sPath není adresář, nebo 
   'pokud obsahuje alespoň jeden soubor
   ' 
   'Požaduje verzi 5.00 a vyšší knihovny Shlwapi.dll 

   IsDirectoryEmpty = PathIsDirectoryEmpty(sPath) = 1 

End Function

Tato funkce funguje i na síťové cesty nebo na URL adresy.

Zpět

Autor: The Bozena