跨源和目标复制多个文件的最佳方法是什么? [英] What's the fatest way to copy multiple files across source and destination?

查看:103
本文介绍了跨源和目标复制多个文件的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我目前正在为一次性创建数千个文件的文件复制过程。我想知道是否有任何.net库可以帮助我以最少的等待时间完成这项任务。

Hi,

I am currently in the process of creating a file copy process for thousands of files in one go. I want to know if there is any .net library that would help me accomplish this task with the least amount of wait time.

推荐答案

我觉得你不需要除 System.IO.File.Copy 之外的任何内容。我不知道你需要如何为副本定义文件集,但你可以使用他 System.IO.Directory 。在实践中,特别是对于UI应用程序,您需要使用单独的线程进行此类操作。



-SA
I don't think you need anything except System.IO.File.Copy. I don't know how you need to define the file set for copy, but you could use he System.IO.Directory. In practice, especially for UI applications, you would need to use a separate thread for such operations.

—SA


我花了一些时间在这上面。不要害怕使用多个线程进行复制操作,即使你会发现一些声称这不会更快的来源。这不是真的 - 只需看看 Robocopy



事实上,Robocopy可能是你的整体解决方案。



-Pete
I've spent some time on this. Don't be afraid to use multiple threads for your copy operations, even though you will find some sources which claim this is not faster. It's not true - just look at Robocopy.

In fact, Robocopy may be your whole solution.

-Pete


这篇关于跨源和目标复制多个文件的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆