![]() I think the reason it doesn't copy smaller files (and it doesn't) is because it only does the work if imod 1000 = 0. ![]() ![]() I understand it was a basic example, which is what I appreciated. I test for that, because if progress is < 100, then either there was an error or the user cancelled the progress, which allows me to do some cleanup or notifications to the user. I don't understand why progress=100 wouldn't work. I figured the copy progress was a little slow. MessengerLogger.Error("There was an error in the procedure: " & IOerror.Message & " :CopyFileWithProgress().") If i Mod 1000 = 0 Then 'only update UI every 1 Kb copied MessengerLogger.Error("The transfer was cancelled at: " & progress & "%.") If FileCopyWorker.CancellationPending Then MessengerLogger.Info("Please wait whilst I upload " & whatoriginationfile) Try Dim temppath As String = GetDirFromPath(whatdestinationfile) & "temp"ĭim sr As New IO.FileStream(whatoriginationfile, IO.FileMode.Open) 'source fileĭim sw As New IO.FileStream(temppath, IO.FileMode.Create) 'target file, defaults overwrite Private Sub FileCopyWorker_DoWork(ByVal sender As Object, ByVal e As ) Handles FileCopyWorker.DoWork
0 Comments
Leave a Reply. |