Set LastWriteTime in the Compact Framework

If you have questions or comments concerning any non-support related 3Dconnexion topic, please use this forum.

Moderator: Moderators

Post Reply
Izza24
Posts: 2
Joined: Wed Nov 21, 2012 2:51 am
Contact:

Set LastWriteTime in the Compact Framework

Post by Izza24 »

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 write time (File.GetLastWriteTime), but the method File.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?
Fred
Moderator
Moderator
Posts: 997
Joined: Wed Dec 06, 2006 7:15 am
Location: Rochester, NY
Contact:

Re: Set LastWriteTime in the Compact Framework

Post by Fred »

I found this on the Web doing a search:

"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."
Post Reply