You can use this progress bar:
https://msdn.microsoft.com/en-us/library/system.windows.forms.progressbar%28v=vs.110%29.aspx[
^].
But you don't have progress to show, and probably you don't need to show it — you read and write all data at once.
For showing progress, you should break your stream in chunks. In your loop, you need to summarize the number of bytes read from input and use it as
Value
if the
Maximum
is the total size of the input stream. Or you can do similar calculations on output stream, but then you need to have correct evaluation of its full size before it's written.
If you do your calculations in a separate thread (recommended in most cases), you would need to notify the UI with progress bar update not directly, but in the UI thread, using
Dispatcher.Invoke
or
Dispatcher.BeginInvoke
. Please see my past answers:
Control.Invoke() vs. Control.BeginInvoke()[
^],
Problem with Treeview Scanner And MD5[
^].
—SA