c# UWP store-app 如何保存应用卸载后不会删除的文件 [英] c# UWP store-app how to save file that will not be deleted after app uninstall

查看:39
本文介绍了c# UWP store-app 如何保存应用卸载后不会删除的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到文件保存到ApplicationData.Current.LocalFolder.CreateFileAsync卸载应用程序后删除文件夹.

I noticed that file saved into ApplicationData.Current.LocalFolder.CreateFileAsync folder is removed after application uninstall.

是否可以保存在卸载应用程序后仍将保留在用户分析器中的文件,以便用户重新安装应用程序时我可以从该用户的文件中读取设置?

Is that possible to save file that will remain in user profiler after application uninstall , so when user re-install application I can read settings from file for this user ?

推荐答案

只有这两种方式是可能的:

Only these two ways are possible:

  1. 让您的用户使用 FilePickerFolderPicker 选择一个文件或文件夹,然后在您的 MostRecentlyUsedList 中跟踪它们.然后您将获得访问用户的永久文件或文件夹的权限.但是您应该注意到您必须在卸载/安装您的应用后再次要求您的用户选择相同的文件或文件夹.请参阅下面的 Microsoft 文档以了解有关它们的更多信息.

  1. Ask your user to pick a file or a folder using FilePicker or FolderPicker and then track them in your MostRecentlyUsedList. Then you'll get the permission to access user's permanent file or folder. But you should notice that you must ask your user again to select the same file or folder after uninstalling/installing your app. See the Microsoft docs below to know more about them.

尝试使用您的云服务器来存储永久文件.这是大多数网络公司产品所做的方法.如果你有能力和金钱来建造或租用服务器,我建议你尝试这种方式.但是在小型个人应用中执行此操作是在浪费时间和金钱.

Try to use your cloud server to store the permanent files. This is the method that most network company products do. If you have to power and money to build or rented server, I recommend you to try this way. But it is a waste of time and money to do this in a small personal app.

总而言之,没有办法像 Win32 桌面应用程序那样轻松地存储永久文件.

For conclusion, There is no way to store a permanent file easily like Win32 Desktop Application.

这篇关于c# UWP store-app 如何保存应用卸载后不会删除的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆