我可以使用下面的代码行复制一个文件,它工作得很好。如果目标文件名中包含复制时的系统日期,我会很高兴。我试过很多方法,但都没能达到目的。有没有人帮我一下?
File.Copy("\Computer1\mall\Files\Computer1.cfg","c:\ComputerFiles\Computer1.cfg",真)
发布于 2019-05-28 02:40:00
您可以使用FileInfo类来设置文件CreationTime、LastAccesstime、LastWriteTime。
Dim fileLocation As String = "c:\ComputerFiles\Computer1.cfg"
Dim fi As New FileInfo(fileLocation)
fi.CreationTime = DateTime.Now
fi.LastAccessTime = DateTime.Now
fi.LastWriteTime = DateTime.Now
https://stackoverflow.com/questions/56330972
复制相似问题