How to create a recursive function to copy all files and folders

后端 未结 4 1226
日久生厌
日久生厌 2020-12-11 04:19

I am trying to create a function that will recursively copy a source folder and all files and folders inside of it to a different location.

At the moment, I have to

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 04:57

    Using GetDirectories/GetFiles is somewhat out of date in my eyes, I would use Directory.EnumerateFileSystemEntries(source); instead as it is faster.

提交回复
热议问题