Overview
- Exposes a file within an isolated store (derives from FileStream).
- Assembly/Machine store for application-level data.
- Assembly/User store for user-level data.
- File paths are relative inside a store.
Good practice
- Don’t write your state to local .xml files all over the system; store it in isolated storage instead.
Examples
Using a Store
IsolatedStorageFile a = IsolatedStorageFile.GetMachineStoreForAssembly();
IsolatedStorageFileStream b = new IsolatedStorageFileStream("MyState.config", FileMode.OpenOrCreate, a);
StreamWriter c = new StreamWriter(b);
c.WriteLine("Hello World!");
c.Close();
foreach (string storeFile in a.GetFileNames("*"))
{
Console.WriteLine(storeFile);
}
IsolatedStorageFileStream d = new IsolatedStorageFileStream("MyState.config", FileMode.Open, a);
StreamReader e = new StreamReader(d);
Console.WriteLine(e.ReadToEnd());
e.Close();
You May Also Like

Exam 70-536 Study Notes
My study notes for Microsoft exam 70-536: .NET types, collections, generics, I/O, serialization and more, with C# examples.

Starting Exam 70-536 Study
After a burnout, I'm putting my own project on hold to study for Microsoft exam 70-536.

Design Patterns - Proxy Pattern
The Proxy Pattern, and the last article in the design patterns series, now that I've finished reading Head First Design Patterns.




