当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - WP8 : Local Storage or Isolated Storage to store data?

问题描述:

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 ?

网友答案:

Both APIs are used to manipulate with an app file system and there is no a restriction for media files. The main difference between these two APIs is that IsolatedStorage type is available just for Windows Phone applications and ApplicationData type is available for Windows Phone applications as well as for Metro Windows 8 applications. So, if you are going to develop your app for both platforms: Windows Phone 8 and Windows 8, I would suggest you to use ApplicationData API, so you can have a common services assembly that is used in both your projects, in WP8 and in Win8 too. On the other hand, both APIs are completely safe. That's mean no any other application can access to the file system of your application. But if you are going to develop an application for WP7.8 and WP8 then you have no choice and have to use IsolatedStorage type.

分享给朋友:
您可能感兴趣的文章:
随机阅读: