locked
Set LastWriteTime in the Compact Framework RRS feed

  • Question

  • I need to change the LastWriteTime property in a smart device project (Windows Mobile 6 Professional), so I'm using the Compact Framework.

    The File class has the support to get the last wirte time (File.GetLastWriteTime), but the methodFile.SetLastWriteTime is not supported.

    I tried using FileInfo class, and its LastWriteTime property, but it is read only for the Compact Framework.

    How can I do?

    Sunday, November 18, 2012 11:34 AM

Answers

  • You probably can P/Invoke SetFileTime() API.

    http://msdn.microsoft.com/en-us/library/ms886812.aspx

    Call CreateFile() to get file handle, then set time and then call CloseHandle() to release file handle.


    This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by doh666 Tuesday, November 20, 2012 10:09 AM
    Sunday, November 18, 2012 5:55 PM