Public Function AllFiles(ByVal DirPath As String) As String()
	Dim sFile As String
	Dim lElement As Long
	Dim sAns() As String
	ReDim sAns(0) As String

	sFile = Dir(DirPath, vbNormal + vbHidden + vbReadOnly + vbSystem + vbArchive)

	If sFile <> "" Then
		sAns(0) = sFile
		Do
			sFile = Dir
			If sFile = "" Then Exit Do
			lElement = IIf(sAns(0) = "", 0, UBound(sAns) + 1)
			ReDim Preserve sAns(lElement) As String
			sAns(lElement) = sFile
		
		Loop
	End If
	AllFiles = sAns
End Function













Dim Files() as String = System.IO.Directory.GetFiles(folderpath)






