我想知道如何将一个文件夹中的文件从今天开始不到 2 天的时间复制到另一个文件夹。
这就是我所拥有的:
Dim source As New DirectoryInfo("C:\Users\username\Desktop\123")
Dim target As New DirectoryInfo("C:\Users\username\Desktop\345")
Dim files = source.GetFiles("*", SearchOption.AllDirectories).Where(Function(file) file.LastWriteTime.Date.Equals(Date.Today.AddDays(-2)))
For Each file As FileInfo In files
file.copy(file.FullName, target.FullName & "\" & file.Name, True)
Next file
编辑:
错误截图: