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