Home
Manage Your Code
Snippet: LINQ to find file (C#)
Title: LINQ to find file Language: C#
Description: LINQ to find a given filename / pattern / etc Views: 222
Author: Mark Henderson Date Added: 5/5/2008
Copy Code  
1var files = from file in new DirectoryInfo(@"K:\SomeFolder").GetFiles()
2    where file.Name == "SomeFileName.txt"
3        select file;
4
Notes
http://devlicio.us/blogs/derik_whittaker/archive/2008/03/30/using-linq-to-access-the-file-system.aspx