Is there a way to get all the files (last modified on a specific date), and save them into a new folder (with the name of the specific date).
Example files:
Inside C:/
Image File Date Modified
Image001.jpg 11/12/2012
Image002.jpg 11/12/2012
Image003.jpg 11/13/2012
Image004.jpg 11/12/2012
Output should be:
C:/20121112/
Image001.jpg
Image002.jpg
Image004.jpg
C:/20121113
Image003.jpg
I am currently using the syntax below:
var mydirectory = new DirectoryInfo("C:/");
DateTime from_date = DateTime.Now.AddDays(-1);
DateTime to_date = DateTime.Now;
var files = directory.GetFiles()
.Where(file=>file.LastWriteTime >= from_date && file.LastWriteTime <= to_date);
But I don't how save to save var files to another folder name.