When kicking off an async job using backgroundworker, the process I tried
is a My.Computer.FileSystem.CopyDirectory(a,b). The next step is to
check the progress with bw.ReportProgress(x) but that statement doesn't get
control until the copydirectory finishes. I'm not new to programming but to
this backgroundworker. Any help would be appreciated. Thank you.
paul1145
0
Newbie Poster
Recommended Answers
Jump to PostThere is no way to report the progress of a single statement operation like
My.Computer.FileSystem.CopyDirectory(a,b)
other than copy started and copy completed. If you want a progress report then you'll have to break up the operation into multiple single-file copies and report the file name and something like copying file …
Jump to PostCopying files in the foreground could make your application unresponsive. When running in the background, be aware that updating progress too frequently will have a performance impact on your operation. If only showing a progress bar, you may consider not updating every iteration, but rather every few iterations.
Jump to PostI was wandering if, maybe, first a total size of the files to be copied could be obtained. Then, we could make an estimation e= Kb copied/second and, why not?, the main thread could show the progress bar, for example, each second a rate:
time elapsed (seconds) / e
All 9 Replies
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Stuugie
commented:
Good tutorial
+6
paul1145
0
Newbie Poster
cgeier
187
Junior Poster
xrjf
213
Posting Whiz
Premium Member
xrjf
213
Posting Whiz
Premium Member
xrjf
213
Posting Whiz
Premium Member
xrjf
213
Posting Whiz
Premium Member
Minimalist
96
Posting Pro
xrjf
213
Posting Whiz
Premium Member
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.