Sometimes as part of your application you need to copy a file. You can use the built it FileCopy for this purpose, but if you are moving large files, or are moving files over a slow connection it will of course take time. Now if the filecopy takes more then a few seconds, the user might start to think that the application has died, since there is no visual indication that anything is going on, and access might even come to the point of saying “Not responding”.
Well there are ways around this. We need to do the filecopy in chunks, and thankfully I found some code for this here.
I took that code, modified it a bit and added my own progress form to show the progress. The result can be seen below, and you can download the sample file at the bottom of this post.
The version below has been updated for 64 bit, per request of Rene (See comments). However I do not have a 64 bit environment to test it in, so please let me know of any issues.