Hey all. I am busy writing a application that i can set up a list of files to copy from one location to a remote network drive.

THe program has a list of "jobs" in a datagrid that it loops through and executes in sequence. What i have now is a background worker that reports the status of which job it is on (File 1 of 5) but i would like something that shows the status of the current copying file as sometimes large files can look like it's stopped on the network

I am using the System.io.file.copy structure, but have also tried the my.computer.filesystem.copyfile (which shows the status in a "windows" copy box)

So, what i would like is some guidance on how to create a function that will copy the file but also report back progress periodicly. I don't want to read and write byte for byte as im worried this will be too slow.

Also, is there a better way/function to use to copy files? Looking for best speed


You can also do something like this:

Dim fromDir As New DirectoryInfo("C:\myFromDir\")'Import IO'
Dim toDir As String = "C:\myToDir\"
Dim fi As FileInfo

For Each fi in FromDir.GetFiles()
    File.Copy(fi.FullName,toDir & fi.Name)

This will copy the file from the source to the destination with the same name.