How to save filenames in an array? When opening the Open File Dialog that the path is obtained and in an array all the names of images or files are saved.
Thanks.
How to save filenames in an array? When opening the Open File Dialog that the path is obtained and in an array all the names of images or files are saved.
Thanks.
Use the method
GetFiles()
of the classDirectory
.This will return an array with all the files that match the search criteria, for example:
It will return all the files with an extension
.jpg
that are in my documents folder.You can't use
OpenFileDialog
to get a route, that's what theFolderBrowserDialog
Using
Directory.GetFiles()
you get the files from the folderHow to: Choose Folders with the Windows Forms FolderBrowserDialog Component