Copy Folder/File wiithout modifying attributes?

前端 未结 3 1690
余生分开走
余生分开走 2020-12-20 03:24

Is it possible to copy a file or a folder from one location to another without modifying its attribute data? For example if I have a folder on a network drive and it was cre

3条回答
  •  时光取名叫无心
    2020-12-20 04:17

    I did something as shown below:

     File.SetCreationTime(tgtFile, File.GetCreationTime(srcFile));
     File.SetLastAccessTime(tgtFile, File.GetLastAccessTime(srcFile));
     File.SetLastWriteTime(tgtFile, File.GetLastWriteTime(srcFile));
    

提交回复
热议问题