I\'d like to retrieve a list of files whose extensions match a specified string exactly.
DirectoryInfo di = new DirectoryInfo(someValidPath); List
Try this:
DirectoryInfo di = new DirectoryInfo(someValidPath); List myFiles = ( from file in di.GetFiles("*.txt") where file.Extension == ".txt" select file ).ToList();