title: Determine when File was Copied to a Directory in Windows 7
body: <p><strong>Problem:</strong> </p>
  
  <p>On Windows XP the following code allowed me to determine if a file had been recently copied to a certain directory (written or overwritten) at some point on the current day. </p>
  
  <p><strong>Behaviour in Win XP:</strong> </p>
  
  <p>If the file was written or overwritten in the directory on the current day, "LastAccessTime" would return a date on the current day. </p>
  
  <p><strong>Behaviour in Windows 7:</strong></p>
  
  <p>It returns the date listed under "Accessed" in the file properties (i.e. via explorer). </p>
  
  <p><strong>Notes:</strong></p>
  
  <ul>
  <li><em><strong>When I use LastWriteTime</em></strong> it returns the "Modified" date shown in the file properties, which is not necessarily the date that the file was copied or overwritten in the current directory.</li>
  </ul>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>DateTime today = new DateTime(DateTime.Now.Year,DateTime.Now.Month,DateTime.Now.Day,0,0,0);
  FileInfo a = new FileInfo("file.txt");
  if (a.LastAccessTime &gt; today)
  {//do something
  }
  </code></pre>