Home › Forums › Support › There are some errors ExamplesWPFFileTransfer demo › Reply To: There are some errors ExamplesWPFFileTransfer demo
Hello
I think I have solved the problem.
I change the code in MainWindow.xaml.cs
public void AddData(long dataStart, int bufferStart, int bufferLength, byte[] buffer)
{
lock (SyncRoot)
{
data.Seek(dataStart, SeekOrigin.Begin);
data.Write(buffer, (int)bufferStart, (int)bufferLength);
ReceivedBytes += (int)(bufferLength – bufferStart);
//add
if (ReceivedBytes == SizeBytes)
{
data.Flush();
}
}
NotifyPropertyChanged(“CompletedPercent”);
NotifyPropertyChanged(“IsCompleted”);
}
Now It’s OK
Best regards
- This reply was modified 10 years, 3 months ago by .
- This reply was modified 10 years, 3 months ago by .