正如在the documentation中所说,我尝试下载文件方式:
try
{
LiveDownloadOperation operation = await connectClient.CreateBackgroundDownloadAsync(filePath);
var result = await operation.StartAsync();
var file = result.File; // It is null
}
catch
{
// Handle errors.
}
但result.File
为空。我认为我的文件路径有问题,就像这样:
path = "file.8c8ce076ca27823f.8C8CE076CA27823F!129"
也尝试过:
path = "file.8c8ce076ca27823f.8C8CE076CA27823F!129/content"
答案 0 :(得分:1)
要阅读文件内容,请使用文件ID + / content,然后访问该流。
示例:
LiveConnectClient liveClient = new LiveConnectClient(liveSession);
LiveDownloadOperation operation =
await liveClient.CreateBackgroundDownloadAsync(fileId + "/content");
var operationResult = await operation.StartAsync();
var fileContent =
await CustomMethod(await operationResult.GetRandomAccessStreamAsync());
return fileContent;