how to get path from file name c# code example Example: c# get folder path from file path Path.GetDirectoryName(filename);