read file name from folder c# code example Example: c# get directory name from filename Path.GetDirectoryName(filename);