Public Function GetFiles(ByVal
pathFolder As String) As ArrayList
Dim returnFiles As ArrayList =
New ArrayListDim dirInfo As DirectoryInfo = New DirectoryInfo(pathFolder)
If dirInfo.Exists Then
Dim filesInfo As FileSystemInfo() = dirInfo.GetFileSystemInfos
For Each fil As FileSystemInfo In filesInfo
If (fil.Attributes = System.IO.FileAttributes.Directory) = False Then
returnFiles.Add(fil.FullName)
Else
If fil.Attributes = FileAttributes.Directory Then
returnFiles.AddRange(GetFiles(fil.FullName))
End If
End If
Next
End If
Return returnFiles
End Function
Nenhum comentário:
Postar um comentário