get the path of a file in c# code example Example: c# get folder path from file path Path.GetDirectoryName(filename);