Search in Files -
I have this snippet that lets me search in files.
var DirInfo = new DirectoryInfo(@"c:\Reports\PdfOutputs"); var files = from file in DirInfo.EnumerateFiles() where file.Name.Contains("128622") || file.Name.Contains("128241") || file.Name.Contains("127361") || file.Name.Contains("127078") || file.Name.Contains("126720") || file.Name.Contains("126590") || file.Name.Contains("124854") || file.Name.Contains("129957") select new { file.Name, file.CreationTimeUtc }; files.Dump();Instead of using file.Name.Contains multiple times, is there a way to do it by having all the names in a list?
Comments