【发布时间】:2015-01-12 15:37:12
【问题描述】:
我使用 Live SDK 5.6 并尝试从 OneDrive 下载文件。使用CreateBackgroundDownloadAsync (innerItem.ID + "/Content"),为什么结果文件为空?
foreach (var innerItem in resultItems.data)
{
if (innerItem.name == "MoneyNote.db")
{
LiveDownloadOperation operation = await liveConnectClient.CreateBackgroundDownloadAsync(innerItem.id + "/Content");
//LiveDownloadOperationResult downloadResult = await operation.StartAsync();
var downloadResult = await operation.StartAsync();
if (downloadResult.File != null)
{
StorageFile downFile = await ApplicationData.Current.LocalFolder.GetFileAsync("MoneyNote.db");
await downloadResult.File.MoveAndReplaceAsync(downFile);
messagePrint(true);
}
else
{
messagePrint(false);
}
}
}
【问题讨论】:
标签: c# windows-phone-8.1 async-await live-sdk