Friday, August 28, 2009

Reading from Isolated Storage

You learned how to write to Isolated Storage in the previous post. Here is how you read from it:
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly();
IsolatedStorageFileStream stream = new IsolatedStorageFileStream("pref.txt", FileMode.OpenOrCreate, isf);
StreamReader sr = new StreamReader(stream);
SetWidthAndHeight(sr.ReadToEnd());
sr.Close();