get file from folder c# code example
Example 1: c# get files of type in directory
string[] files = System.IO.Directory.EnumerateFiles(directory, "*.*").ToArray();
Example 2: c# retrieve files in folder
using System.IO;
string[] filePaths = Directory.GetFiles(@"c:\MyDir\");
// returns:
// "c:\MyDir\my-car.BMP"
Example 3: c# retrieve files in folder
string[] filePaths = Directory.GetFiles(@"c:\MyDir\", "*.bmp");
Example 4: c# retrieve files in folder
string[] filePaths = Directory.GetFiles(@"c:\MyDir\", "*.bmp",
SearchOption.AllDirectories);