I am taking information from a form, saving it to isolated storage and building a list of the different entries on a separate page. I can display the text of the first data entry but simply can't figure out how to continue to store them in the same file.
This is my Form Page:
var multipleStorage = IsolatedStorageFile.GetUserStoreForApplication();
string multipleFile = "multipleFile.txt";
using (var file = multipleStorage.OpenFile(multipleFile, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write))
{
using (var writer = new StreamWriter(file))
{
writer.Write(nameTextBox.Text + ", " + dunsTextBox.Text + ", " + typeCheck + ", " + resellerCheck + System.Environment.NewLine);
}
}
And this is my receiving page:
private void resultTextBlock_Loaded(object sender, RoutedEventArgs e)
{
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
using (StreamReader sr = new StreamReader(store.OpenFile("multipleFile.txt", FileMode.Open, FileAccess.Read)))
{
resultTextBlock.Text = sr.ReadToEnd();
}
}
}