Friday, 8 June 2012

Enumerate Files in a Directory using LINQ

List All files in a Directory using LINQ


            expr=System.IO.Directory.EnumerateFiles("C:\\");
            foreach (String file in expr)
            {
                Console.WriteLine(file);
            }

It displays complete path+filename.

No comments:

Post a Comment