c# get files of type in directory code example
Example 1: c# get files of type in directory
string[] files = System.IO.Directory.EnumerateFiles(directory, "*.*").ToArray();
Example 2: get directory of file c#
using System.IO;
string file = "C:\Documents\file.txt";
Path.GetDirectoryName(file);