update , this code is from the following articles:
Simple WP7 Mango app for background tasks, toasts and slabs Simple WP7 Mango app for background tasks, toasts and snippets: code explanation
Isolated storage works well.
This is the class that I use to serialize and deserialize an instance in json (or xml) in IsolStorage. This example uses ServiceStack.Text , but you can disable it.
To use, read and write:
public class MyClass { public void Save() { MutexedIsoStorageFile.Write(this, "MyClass.json", "MYCLASSJSON"); } public static MyClass Load() { return MutexedIsoStorageFile.Read<MyClass>("MyClass.json", "MYCLASSJSON"); } } public static class MutexedIsoStorageFile { public static T Read<T>(string fileName, string mutexName) where T : new() { var mutexFile = new Mutex(false, mutexName); var model = new T(); mutexFile.WaitOne(); try { using (var store = IsolatedStorageFile.GetUserStoreForApplication()) using (var stream = new IsolatedStorageFileStream(fileName, FileMode.OpenOrCreate, FileAccess.Read, store)) using (var reader = new StreamReader(stream)) if (!reader.EndOfStream) {
source share