参考代码
Dim ofd As OpenFileDialog = New OpenFileDialog()
Dim res As DialogResult = ofd.ShowDialog()
If res = DialogResult.OK Then
If Not String.IsNullOrEmpty(ofd.FileName) Then
Dim streamRead As io.FileStream = New io.FileStream(ofd.FileName, io.FileMode.Open)
Dim data As Byte() = New Byte(1048575) {}
Dim length As Integer = 0
Dim sfd As SaveFileDialog = New SaveFileDialog()
Dim sres As DialogResult = sfd.ShowDialog()
If sres = DialogResult.OK Then
If Not String.IsNullOrEmpty(ofd.FileName) Then
Dim streamWrite As io.FileStream = New io.FileStream(sfd.FileName, io.FileMode.Create)
StatusBar.ProgressBar.Visible = True
StatusBar.ProgressBar.Maximum = streamRead.length
StatusBar.ProgressBar.Minimum = 1
application.doevents
Do
length = streamRead.Read(data, 0, data.Length)
StatusBar.ProgressBar.value += length
application.doevents
'For i As Integer = 0 To length - 1
' data(i) = CByte((255 - data(i)))
'Next
streamWrite.Write(data, 0, length)
Loop While length = data.Length
streamWrite.close
End If
End If
End If
End If