strYear 的值为 1976。我将创建日期设置为 1976 年 1 月 1 日,但没有任何反应。如果年份是 1977 年、1978 年或 1979 年,则不起作用。这可能是什么原因造成的?日期只能从 1980 年开始吗?
//Change File Created Date to Januray 1 and the year of the file already in meta-data
DateTime datTime = new DateTime(Convert.ToInt16(strYear), 2, 2, 12, 59, 0, 0);
File.SetCreationTime(files, datTime);
最佳答案
这可能来自文件系统的最短时间,对于 FAT 或 MS-DOS 兼容文件系统,该时间为 1980。
我猜 NTFS 卷将支持一直追溯到 1601。FAT 只能追溯到 1980。
关于c# - 将文件创建日期设置为 1976 年 1 月 1 日,但除非年份在 1980 年之后,否则任何操作都不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54813486/