我想配置一个UWP App 以便从 Edge Extension 接收消息,并使用一些外部配置来回答这些消息:我尝试使用Windows Credentials Vault,但似乎无法访问它(UWP App似乎在沙盒中运行),没有 Windows Credential Vault 的可见性)。
所以我的问题是:有没有办法手动配置 UWP 应用程序而不将配置部署到商店中?
非常感谢,
丹尼尔
问问题
120 次
1 回答
0
我不知道这是否是最佳选择,但 UWP 应用程序可以从本地存储中读取文件。
因此,安装完成后,我在本地存储目录 (%USERPROFILE%\AppData\Local\Packages\\LocalState) 中编写了一个配置文件,我可以使用以下代码从 UWP 应用程序访问它:
Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
Windows.Storage.StorageFile configFile = await storageFolder.GetFileAsync("config");
String configContent = await Windows.Storage.FileIO.ReadTextAsync(configFile);
//configContent now contains the config info
于 2017-09-18T09:57:43.153 回答