using Microsoft.Phone.Controls;
using System.IO.IsolatedStorage;
using System.IO;

namespace WPCreateAndWriteFile
{
    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();

            SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Landscape;

            try
            {
                IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication();
                IsolatedStorageFileStream filestream = file.CreateFile("HelloWorld.txt");
                StreamWriter sw = new StreamWriter(filestream);
                sw.WriteLine("Hello World");
                sw.Flush();
                filestream.Close();
            }
            catch (IsolatedStorageException ise)
            {
                //Fehlerbehandlung
            }
        }
    }
}