Probably the easiest way, given the code you have already written is to declare an Integer Property (call it something like
BytesWritten
) In the Setter for this property have:
_BytesWritten += Value
ProgressBar1.Value = _BytesWritten
Then replace this line:
objWriter.WriteLine(strFinalString)
with:
objWriter.WriteLine(strFinalString)
BytesWritten += strFinalString.Length
and get rid of your do-loop entirely