Introduction
In this article we will explore how to use the Isolated Storage Explorer tool in Windows Phone 7. In further details, if we have an XML file and want to save it to the isolated storage explorer location and also want to see that file that it is really made or not. So Isolated Storage Explorer tool will make it easy that how to see that file and you can easily download that file easily on your computer. You can download that XML file from the Isolated Storage Explorer tool which is an advantage of the In this we have sure that it is stored isolated on the explorer tool and will see that path where it will located. Let's have a look on such type of functionality and for that we have to see the steps given below to implement it which is described below:
Step 1: First of all you have to download the tool named Isolated Storage Explorer tool and install it in your PC.
Step 2: In this step we have to take a new Windows Phone application
- Go to New-->Project
- Select template Silverlight for Windows Phone
- Choose a Windows Phone application

Step 3: In this step you have to add the assembly reference named IsolatedStorageExplorer.dll; let's see where you have to add that library references to.
First of all we have to go to the Solution Explorer and click on References then right-click and select "Add Reference..."; let's see how to add it, which is shown below.

Secondly select the browse tab and go to program files and choose the "WP7 Isolated Storage Explorer" tool.

Thirdly you have to Browse to the "WP7 Isolated Storage Explorer" directory and choose the library folder.

In this you just see a .dll file named IsolatedStorageExplorer.dll; you have to select it and click OK.

In this step you will see that there is an assembly that was added inside the references folder, as shown in figure given below.

Step 4: In this step we will write the code for the whole application code which is given below; this is for the MainPage.xaml.cs file.
Code:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using System.Net;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Animation;
using
System.Windows.Shapes;
using
Microsoft.Phone.Controls;
using
System.IO.IsolatedStorage;
using System.IO;
using System.Xml;
using
System.Xml.Serialization;
using
System.Xml.Linq;
namespace
IsoStoreExploredTest
{
public partial
class MainPage
: PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void
Button_Click(object sender,
RoutedEventArgs e)
{
using (IsolatedStorageFile
myStore = IsolatedStorageFile.GetUserStoreForApplication())
{
if (!myStore.FileExists("categorie_settings.xml"))
{
using (IsolatedStorageFileStream
myStream = new
IsolatedStorageFileStream("categorie_settings.xml",
FileMode.Create, myStore))
{
XNamespace _name = "";
XDocument new_doc = new
XDocument(
new
XDeclaration("1.0",
"utf-8", ""),
new
XElement(_name +
"Root",
new
XElement("Row",
new
XElement("Name",
"Homepage2"),
new
XElement("Tipo",
"News2"),
new
XElement("URL",
"/web/xml2"),
new
XElement("Err",
"Errore2")
)));
new_doc.Save(myStream);
}
}
else
{
XDocument doc1;
using (IsolatedStorageFileStream
myStream = new
IsolatedStorageFileStream("categorie_settings.xml",
FileMode.Open, myStore))
{
doc1 = XDocument.Load(myStream);
}
var root = doc1.Element("Root");
var rows = root.Descendants("Row");
var lastRow = rows.Last();
lastRow.AddAfterSelf(
new
XElement("Row",
new
XElement("Name",
"Homepage2"),
new
XElement("Tipo",
"News2"),
new
XElement("URL",
"/web/xml2"),
new
XElement("Err",
"Errore2")));
using (IsolatedStorageFileStream
myStream = new
IsolatedStorageFileStream("categorie_settings.xml",
FileMode.Create, myStore))
{
doc1.Save(myStream);
}
}
string[] subDirectories =
myStore.GetDirectoryNames();
}
}
}
}
Step 5: In this step we will see the MainPage.xaml code that we have to write for that page, as shown below.








Join the conversation! Your thoughts help the community grow.