我正在使用以下代码修改文本文件的创建日期:
using System.IO;
...
DateTime newCreate = new DateTime(year, month, day, hour, minutes, seconds);
File.SetCreationTime("changemydate.txt", newCreate);
然而这并没有起到作用。没有错误消息,但是它根本没有改变文件的日期。
我在Dropbox文件夹和一个随机文件夹中尝试了这个方法,但都没有成功。
DateTime newCreate
对象似乎是正确的。
如果有人能给我指点一个思路,那就太好了......