how do i allow this code to retrieve the files from a directory? For example, my directory name is “Folder Name”:
private ObservableCollection<FileItem> LoadFiles()
{
ObservableCollection<FileItem> files = new ObservableCollection<FileItem>();
foreach (string filePath in this.Store.GetFileNames())
files.Add(new FileItem { FileName = filePath });
return files;
}
EDIT:
I’ve tried this, and it still isn’t working:
private ObservableCollection<FileItem> LoadFiles()
{
ObservableCollection<FileItem> files = new ObservableCollection<FileItem>();
foreach (string filePath in this.Store.GetFileNames())
files.Add(new FileItem { "FlashCardApp\\" + FileName = filePath });
return files;
}
I’ve finally found the answer to my own question.
This is how it is suppose to be:
By having \ after the folder name,
"FlashCardApp\\", it will retrieve the files from the directory.