gpt4 book ai didi

c# - 无法从 'System.IO.IsolatedStorage.IsolatedStorageFileStream' 转换为 'Windows.Storage.IStorageFile'

转载 作者:太空宇宙 更新时间:2023-11-03 10:43:03 25 4
gpt4 key购买 nike

我将文档 (.doc) 存储在我的应用程序的 IsolatedStorage 中。我需要在 Office 应用程序中打开该文档。

经过很长时间的搜索,我编写了如下代码。但它显示错误。我需要知道如何将 IsolatedStorageFileStream 转换为 IStorageFile。

这是我的代码:

var file = new IsolatedStorageFileStream(sFile, FileMode.Open, myFile);
await Launcher.LaunchFileAsync(file);

最佳答案

我自己找到了答案:

var file = await ApplicationData.Current.LocalFolder.GetFileAsync(sFile);
await Launcher.LaunchFileAsync(file);

关于c# - 无法从 'System.IO.IsolatedStorage.IsolatedStorageFileStream' 转换为 'Windows.Storage.IStorageFile',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24571754/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com