0
我在商店中有一个Windows Phone 8.1应用程序。现在我创建了一个uwp更新。我的问题是: 如果我将应用程序的更新加载到商店中并且用户执行此更新。该应用是刚刚覆盖或卸载,然后新安装的? ApplicationData.Current.LocalSettings中保存的设置是否被删除?8.1应用程序的商店更新为uwp应用程序
THX newone
我在商店中有一个Windows Phone 8.1应用程序。现在我创建了一个uwp更新。我的问题是: 如果我将应用程序的更新加载到商店中并且用户执行此更新。该应用是刚刚覆盖或卸载,然后新安装的? ApplicationData.Current.LocalSettings中保存的设置是否被删除?8.1应用程序的商店更新为uwp应用程序
THX newone
TL; DR; - 从WP8.1运行时更新到UWP( - 快速环与移动设备与内幕预览测试)时它保留在LocalFolder和LocalSettings数据。
我碰到类似的测试,like the last time:
private async void Generate_Click(object sender, RoutedEventArgs e)
{
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("test.txt");
await FileIO.WriteTextAsync(file, "Something inside");
}
private async void CheckFile_Click(object sender, RoutedEventArgs e)
{
try
{
StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync("test.txt");
string text = await FileIO.ReadTextAsync(file);
await new MessageDialog($"File exists = {text}").ShowAsync();
}
catch (Exception) { await new MessageDialog("File desnt exists").ShowAsync(); }
}
private void GenerateSetting_Click(object sender, RoutedEventArgs e) => ApplicationData.Current.LocalSettings.Values["CHECK"] = "Test value";
private async void CheckSetting_Click(object sender, RoutedEventArgs e)
{
if (ApplicationData.Current.LocalSettings.Values.ContainsKey("CHECK"))
await new MessageDialog($"Setting exists = {ApplicationData.Current.LocalSettings.Values["CHECK"]}").ShowAsync();
else await new MessageDialog("Setting doesn't exist").ShowAsync();
}
:为用于测试按钮的代码