Reputation: 937
I'm able to download file from FTP server. Now I want to save that file retaining the time of the file in the ftp server. How can I do that in c#?
example: FILE NAME: File1.gz DATE: 8/16/2014 8:00:00 AM
I'll download File1.gz today which is 8/18/2014 but I want to save the date of my download as 8/16/2014 8:00:00 AM.
What I mean is how can I save to make my file date same as the file date in the ftp server.
Upvotes: 0
Views: 1253
Reputation: 14522
You can easily set the creation date of a file with this:
File.SetCreationTime("File1.gz", someDate);
More usage and example can be found here.
Upvotes: 1