As of now we have learned about the various file storiage techniques and in this article we will start with the first one in detail. In other words, storing data using WP7.1 Isolated Storage APIs. First of all we need to have a namespace so for this we have the namespace "System.IO.IsolatedStorage". Here is a quick definition of terminology used in Isolated Storage:
- IsolatedStorageFile: represents an isolated storage containing files and directories.
- IsolatedFileStrem: exposes a file stream access to a file stored within Isolated Storage.
- IsolatedStorageSettings: it is a very nice name/value pair dictionary, that is basically used to store the settings of your application.
Saving Data
Now that we have understand the terminology, lets's take a quick look at how data is stored. The following is the sample code:
private void saveData(string message)
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream fstream = isf.CreateFile("Mydata.store"))
{
StreamWriter writer = new StreamWriter(fstream);
writer.WriteLine(message);
writer.Close();
}

Join the conversation! Your thoughts help the community grow.