latest file

  • Thread starter Thread starter MFRASER
  • Start date Start date
M

MFRASER

Is there a quick way to get the most recently created file based on a wild
card search?

for example if I want to get the latest file in c:\temp\*.xml
 
Look into the system.io.directory.GetFiles method, it has a searchPattern
property that you can use to get a list of wild card matched files. You can
probably loop through the array and compare the file date.
 
Back
Top