Guys I have been creating a program that copies and moves files from folder to folder;
I am using this sort of code;

fileToCopy.CopyTo("path here...")


FileToMove.MoveTo("path here...")

My problem is, when I am copying or moving a large file, It's taking so much time and my program is hanging until all the files are completely moved or copied. How about, using a progressbar instead, so that the user will be able to see the progress of copying and moving instead of the program freezing? If this is doable, can anyone share knowledge about it? Thanks in advance...

Recommended Answers

All 3 Replies

execute your copy/move method in a separate thread.
Set the max value of the progressbar to the original file filesize and update the progressbar to the copied file current size, using a timer.

commented: "...update the progressbar..." = :) +12

what do you mean by a separate thread? you mean program?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.