File loading by date

  • Thread starter Thread starter Steven Blair
  • Start date Start date
S

Steven Blair

Hi, I have a windows service monitoring a directory for files, which
works fine. The problem I have is when I pick up a file, it needs to be
the oldest file first.

Anyone any idea how to do this?

Regards,

Steven
 
Hi Steven,
Hi, I have a windows service monitoring a directory for files, which
works fine. The problem I have is when I pick up a file, it needs to be
the oldest file first.

Anyone any idea how to do this?

Regards,

Steven

I can recommend You to write class with IComparer implementation
(objects of FileInfo class) with LastWriteTime or CreationTime as
comparation items.
Then if you get all files from directory e.g. by
DirectoryInfo.GetFiles[] then you can easily sort them
with Array.Sort(Array, IComparer).

Cheers!

Marcin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top