0

正如文档中所说,我尝试下载文件方式:

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"

怎么了?它是一个 Windows 运行时应用程序,使用 LiveSDK 5.6

4

1 回答 1

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;
于 2014-06-11T09:49:43.380 回答