KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to copy files from one directory to another and test based upon the file creation date. File.Copy(fileName, directory + fileNameOnly, true); The problem occurs later in my program when I checked the creation date to ensure it is no more than 5 days old. FileInfo file = new FileInfo(fileName); if (file.CreationTime.AddHours(120) < DateTime.Now) {} I have seen that the creation date when copied back is set to 1980-01-01. This is not useful for my requirements as I would like maintain the creation date from the original file. Is there another method of comparing the dates or is it the copy that loses the creation date value. I guess my question is, how can I maintain the Creation Date?
Tags (comma-separated)
Save Edits
Cancel