C# get names of files in a directory code example Example: c# get directory name from filename Path.GetDirectoryName(filename);