using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace SchreibenUndLesen
{
    class Program
    {
        static void Main(string[] args)
        {
            /*** Datei schreiben ***/

            FileStream fs = new FileStream(@"C:\temp\file.txt", FileMode.Append);
            StreamWriter sw = new StreamWriter(fs);

            sw.Write("Text in Datei");

            sw.Close();
            fs.Close();


            /*** Datei lesen ***/

            FileStream fs2 = new FileStream(@"C:\temp\file.txt", FileMode.Open);
            StreamReader sr = new StreamReader(fs2);

            string s = sr.ReadToEnd();

            Console.WriteLine(s);

            sr.Close();
            fs2.Close();

            Console.ReadLine();

        }
    }
}
