3

For a Windows Phone 8 application, I always heard that data can be stored in the "isolated storage" of the phone. After some research, I found two namespaces: LocalStorage (WinRT but supported too in WinPRT) and IsolatedStorage and they both seem to store data. This is what I understood so far :

  • IsolatedStorage is a virtual file system so you cannot interact with user media for instance
  • LocalStorage seems to have a real isolated storage as data is stored in a folder associated to the app

In the IsolatedStorage, can data from various apps mix ? I want a way to have a real safe isolated place to store data with no extenal interaction from other apps. This data could be settings preferences.

The problem is that I do not know very well those APIs and my testing programs around them lead to new questions. What is the real difference between those namespaces and which one could fulfill my need explained above ?

4

1 回答 1

6

这两个 API 都用于操作应用程序文件系统,并且对媒体文件没有限制。这两个 API 之间的主要区别在于IsolatedStoragetype 仅可用于 Windows Phone 应用程序,而ApplicationDatatype 可用于 Windows Phone 应用程序以及 Metro Windows 8 应用程序。因此,如果您要为这两个平台开发应用程序:Windows Phone 8 和 Windows 8,我建议您使用ApplicationDataAPI,这样您就可以在 WP8 和 Win8 中的两个项目中使用通用服务程序集也。另一方面,这两个 API 都是完全安全的。这意味着没有任何其他应用程序可以访问您的应用程序的文件系统。但如果你要为 WP7.8 和 WP8 开发应用程序,那么你别无选择,必须使用IsolatedStoragetype。

于 2013-06-30T13:57:25.080 回答