Preserve File Date/Time Stamp

Sep 6, 2012 at 6:53 PM

Hello.

I got it working and am quite happy with it.

Is there any easy way of preserving the file's date/time stamp when it gets copied?

 

Nov 8, 2012 at 2:57 PM

In the System.IO namespace, you can use the following instructions:

  • File.SetCreationTime(filename, dateInfo)
  • File.SetLastWriteTime(filename, dateInfo)

You can reuse for "dateInfo" parameter the information that you find in "DirectoryListItem" class, the "CreationTime" field.

Hope it helps,

Greg.

 

 

 

 

 



Feb 7, 2013 at 6:22 AM
<div dir="ltr">Thank you very much Gregory. I will try it at work tomorrow and see if I can get it to work. <div><br> </div> <div>Very sorry for the late response, it went to a junk email on a email account I rarely use.</div> <div><br> </div> <div>Thanks Again</div> <div>Greg (also)<br> <br> <div> <div id="SkyDrivePlaceholder"></div> <hr id="stopSpelling"> From: [email removed]<br> To: [email removed]<br> Date: Thu, 8 Nov 2012 07:57:53 -0800<br> Subject: Re: Preserve File Date/Time Stamp [ftps:394681]<br> <br> From: gregorysch<br> <div id="ecxThreadNotificationPostBody">In the System.IO namespace, you can use the following instructions:<br> <ul> <li>File.SetCreationTime(filename, dateInfo) </li><li>File.SetLastWriteTime(filename, dateInfo) </li></ul> You can reuse for &quot;dateInfo&quot; parameter the information that you find in &quot;<strong><em>&#65279;DirectoryListItem</em></strong>&quot; class, the &quot;<strong><em>CreationTime</em></strong>&quot; field.<br> Hope it helps,<br> Greg.<br> <br> <br> <br> <br> <br> &#65279;&#65279;&#65279;<br> </div> <div id="ecxThreadNotificationFooter">Read the <a href="http://ftps.codeplex.com/discussions/394681#post938588" target="_blank"> full discussion online</a>.<br> To add a post to this discussion, reply to this email (<a href="mailto:ftps@discussions.codeplex.com?subject=[ftps:394681]">ftps@discussions.codeplex.com</a>)<br> To start a new discussion for this project, email <a href="mailto:ftps@discussions.codeplex.com"> ftps@discussions.codeplex.com</a><br> You are receiving this email because you subscribed to this discussion on CodePlex. You can <a href="https://ftps.codeplex.com/discussions/394681/unsubscribe/" target="_blank"> unsubscribe</a> on CodePlex.com.<br> Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com<br> </div> </div> </div> </div>