如何修改文件的创建时间并保存到原文件?c#编程

2024-11-19 18:30:51
推荐回答(1个)
回答1:

OpenFileDialog file = new OpenFileDialog();
if (file.ShowDialog()== System.Windows.Forms.DialogResult.OK)
{
System.IO.FileInfo fileInfo = new System.IO.FileInfo(file.FileName);
fileInfo.CreationTime = DateTime.Now;
}