Plocka ut filer ur katalog – VB.net

Plocka ut filer ur katalog – VB.net

Dim folderInfo As New IO.DirectoryInfo("c:\windows")
Dim arrFilesInFolder() As IO.FileInfo
Dim fileInFolder As IO.FileInfo

arrFilesInFolder = folderInfo.GetFiles("*.*")
For Each fileInFolder In arrFilesInFolder
ListBox1.Items.Add(fileInFolder.Name)
Next