Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET: How to copy files using Windows "Copy Files" dialog

.NET: How can I copy the files using Windows "Copy Files" dialog. I need to bulk copy multiple files. Does there exists any .NET 2.0 library/method that allows me to do it in crossplatform manner without invoking Windows platform specific libraries.

Thanks in advance.

like image 564
Murat from Daminion Software Avatar asked Oct 29 '25 00:10

Murat from Daminion Software


1 Answers

SHFileOperation, it is well supported by the standard .NET framework. Add a reference to Microsoft.VisualBasic.dll and use the Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory() method. Several overloads are available that allows you to control what the UI looks like and how to handle errors.

like image 115
Hans Passant Avatar answered Oct 31 '25 15:10

Hans Passant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!