[Solved] Searching folders and subfolders for a file and get its size depending on the name


string adPicturesPath = ConfigurationManager.AppSettings["AdPicturesPath"];
List<string> files = new List<string> { "235253325_23522.jpg" };
var allFiles = files.SelectMany(fn => Directory.EnumerateFiles(adPicturesPath, fn, System.IO.SearchOption.AllDirectories));
long allFileSizeBytes = allFiles.Sum(fn => new FileInfo(fn).Length);

1

solved Searching folders and subfolders for a file and get its size depending on the name