this could work for you.
using System.Linq;
DirectoryInfo info = new DirectoryInfo("PATH_TO_DIRECTORY_HERE");
FileInfo[] files = info.GetFiles().OrderBy(p => p.CreationTime).ToArray();
foreach (FileInfo file in files)
{
// DO Something...
}
More Related Contents:
- Is there a way to check if a file is in use?
- Easiest way to read from and write to files
- Nested using statements in C#
- How to change the timeout on a .NET WebClient object
- How to find the most recent file in a directory using .NET, and without looping?
- Best way to resolve file path too long exception
- Better way to check if a Path is a File or a Directory?
- C# – Get a list of files excluding those that are hidden
- Mirroring console output to a file
- How to get files in a relative path in C#
- Why does Path.Combine not properly concatenate filenames that start with Path.DirectorySeparatorChar?
- How can I create a temp file with a specific extension with .NET?
- How to remove a single Attribute (e.g. ReadOnly) from a File?
- How to insert characters to a file using C#
- How do I get the directory from a file’s full path?
- Check if an executable exists in the Windows path
- Read random line from a file? c#
- Delete files older than 3 months old in a directory using .NET
- Encrypt SQLite database in C#
- C# Searching for files and folders except in certain folders
- How to flatten tree via LINQ?
- Why does the order of alternatives matter in regex?
- When should I use Lazy?
- Does .NET FtpWebRequest Support both Implicit (FTPS) and explicit (FTPES)?
- How to make make a .NET COM object apartment-threaded?
- What is the difference between int, Int16, Int32 and Int64?
- Encoding parameters for a URL
- Looking for a Command Line Argument Parser for .NET [closed]
- The extern alias ‘xxx’ was not specified in a /reference option
- ThreadStaticAttribute in ASP.NET