Change file LastWriteDate in Compact Framework
问题 FileSystemInfo.LastWriteTime property is readonly in CF. Is there an alternative way to change that date? 回答1: P/Invoke SetFileTime. EDIT Something along these lines (warning: untested) [DllImport("coredll.dll")] private static extern bool SetFileTime(string path, ref long creationTime, ref long lastAccessTime, ref long lastWriteTime); public void SetFileTimes(string path, DateTime time) { var ft = time.ToFileTime(); SetFileTime(path, ref ft, ref ft, ref ft); } 回答2: Here is a fuller