Assuming your goal is to parse the contents of the files in the Directory:
C:\Users\for\AppData\Roaming\Mozilla\Firefox\Profiles
And, find the first folder that contains a file named 'places.SQlite
whose name is not: 'fl43ywmg.default:
using System.IO;
using System.Linq;
private List<string> IgnoreDirectories = new List<string>
{
"fl43ywmg.default", "Aunt Betty's Brown Bread", "Papa's Baked Beans"
};
private string basePath = @"C:\Users\for\AppData\Roaming\Mozilla\Firefox\Profiles\";
private void TestFindDirectory()
{
string searchFilter = "*";
var directories = Directory.EnumerateDirectories(basePath, searchFilter,
SearchOption.AllDirectories).Select(dir => dir.Replace(searchFolderPath, ""));
string directoryName = directories.First(dir => (! IgnoreDirectories.Contains(dir)));
}
Comment: depending on what information you wish to get from the enumerated file, or files, that match your criteria, you may wish to consider searching the enumerated FileInfo of Directories using 'DirectoryInfo.EnumerateDirectories. You could easily substitute using that here with a few changes.