string[] GetFiles = Directory.GetFiles(DirectoryPath);
TopDirectoryOnly
string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); string[] files = Directory.GetFiles(path, "*.*", SearchOption.TopDirectoryOnly); var result = files.Select(a=>Path.GetFileName(a));
file1.xlsx file2.bmp file3.docx
I want to get all the files from a specific dieectory....The problem is that it gets the folder too.
var fileList= Directory .GetFiles("Your directory path", "*", SearchOption.AllDirectories) .Select(Path.GetFileName);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)