Question: My objective is to save "textbox" input to a text file and then being able to load that saved text from the same text file back to a textbox.

I think that one of my mistakes is reading on Console.

```
namespace aaa
{
    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string fileName = "test.txt";

            FileStream fs = null;

            fs = new FileStream(fileName, FileMode.CreateNew);
            StreamWriter writer = new StreamWriter(fs);

            writer.Write(textBox1.Text);
        }

        private void btnWrite_Click(object sender, RoutedEventArgs e)
        {

        }

        private void btnRead_Click(object sender, RoutedEventArgs e) 
        {
            public static void Main() 
            {
                using (StreamReader sr = new StreamReader("test.txt")) 
                {
                    string line;
                    while ((line = sr.ReadLine()) != null) 
                    {
                        Console.WriteLine(line);
                    }
                }
            }
        }   
    }
}

```

Answer: 
Use Windows.Storage.StorageFile in both Windows Phone Runtime and Windows Phone Silverlight apps.

There are examples in the MSDN documentation in the [Working with data and files](https://msdn.microsoft.com/en-us/library/windows/apps/xaml/br229562.aspx) section. In particular see [Quickstart: Local app data](https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh700361.aspx) or [Quickstart: Roaming app data](https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh700362.aspx) and [Quickstart: Reading and writing files](https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh758325.aspx)

This last Quickstart has demos directly on reading and writing short text snippets to a file:

```
// Create sample file; replace if exists.
StorageFolder folder =
    Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile sampleFile =
    await folder.CreateFileAsync("test.txt", CreationCollisionOption.ReplaceExisting);
await Windows.Storage.FileIO.WriteTextAsync(sampleFile, textBox1.text);

```
in windows phone you don't have such a direct access to the file system. 

you can use the isolated file storage to read and write files.

here you find a broad overview of the features:

<https://msdn.microsoft.com/library/system.io.isolatedstorage.isolatedstoragefile>

(Caution: This is for windows phone 7, for windows phone 8.1 see the other answer)