我必须将一个mp4(Windows Phone 8.1 App C#)上传到ftp,它实际上可以使用以下代码...但即使经过几天的尝试,我也只是不知道怎么写条件在一段时间的结束。我可以得到文件的大小,但不知道如何检查写入的字节?请帮帮我
using (var stream2 = await ftpClient.OpenWriteAsync(PathToSet + FileName + ".mp4"))
{
using (var readStream = await videofile.OpenReadAsync())
{
IBuffer buffer = await FileIO.ReadBufferAsync(videofile);
DataReader reader = DataReader.FromBuffer(buffer);
byte[] fileContent = new byte[reader.UnconsumedBufferLength];
//int FileSize = Convert.ToInt32(reader.UnconsumedBufferLength);
while (true)
{
fileContent = new byte[reader.UnconsumedBufferLength];
reader.ReadBytes(fileContent);
await stream2.WriteAsync(fileContent.AsBuffer());
if(???) break;
}
await stream2.FlushAsync();
}
}