配置 UWP 本机消息应用程序

Configure UWP Native Messagging App


我想配置 UWP App in order to receive messages from an Edge Extension, and to answer to these messages using some external configurations: I tried to use the Windows Credentials Vault, but it seems impossible to access it (the UWP App seems running in a SandBox),不显示 Windows 凭据库。
所以我的问题是:有没有办法在不将配置部署到商店的情况下手动配置 UWP 应用程序?

非常感谢,
丹妮尔

我不知道这是不是最好的选择,but an UWP app can read a file from the local storage
因此,在安装完成后,我在本地存储目录 (%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