LINQ to find file

CodeKeep C# Feed Maggio 5th, 2008

Description: LINQ to find a given filename / pattern / etc

Link: http://www.codekeep.net/snippets/5195652d-2810-4006-809c-b4bcdaf699cd.aspx

var files = from file in new DirectoryInfo(@"K:\SomeFolder").GetFiles()
    where file.Name == "SomeFileName.txt"
        select file;

  • .NET
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Comments are closed.

Trackback URI |