StreamReader and streamwriter
<p>what mean this exception please ?   </p>

<blockquote>
  <p>Unhandled Exception: System.ObjectDisposedException: The object was
  used after being disposed.
        at System.IO.StreamWriter.Write (System.String value) [0x00000]
  in :0 
        at System.IO.TextWriter.WriteLine (System.String value)
  [0x00000] in :0 
        at fichier.MainClass.Main (System.String[] args) [0x000bd] in
  /Users/mediatun1/Projects/fichier/fichier/Main.cs:122</p>
</blockquote>

<pre><code>  System.Security.Cryptography.MD5 alg = System.Security.Cryptography.MD5.Create();
    System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
    byte[] md5val = alg.ComputeHash(enc.GetBytes("TESTTESTTESTTESTTESTTEST"));
    string output = Convert.ToBase64String(md5val);
    string pathPlainTextFile="/Users/mediatun1/Desktop/IAAT.xml"; 
    string pathCypheredTextFile="/Users/mediatun1/Desktop/IAA.xml";
    StreamReader fsPlainTextFile = File.OpenText(pathPlainTextFile);

    FileInfo t = new FileInfo(pathCypheredTextFile);
    StreamWriter Tex =t.CreateText();
    string input = null;
    while ((input = fsPlainTextFile.ReadLine()) != null)
    {


                  byte[] plainText = Encoding.UTF8.GetBytes(input);



                RijndaelManaged rijndael = new RijndaelManaged();

                // Définit le mode utilisé
                rijndael.Mode = CipherMode.ECB;

                // Crée le chiffreur AES - Rijndael
                ICryptoTransform aesEncryptor = rijndael.CreateEncryptor(md5val,null);

                MemoryStream ms = new MemoryStream();

                // Ecris les données chiffrées dans le MemoryStream
                CryptoStream cs = new CryptoStream(ms, aesEncryptor, CryptoStreamMode.Write);
                cs.Write(plainText, 0, plainText.Length);
                cs.FlushFinalBlock();


                // Place les données chiffrées dans un tableau d'octet
                byte[] CipherBytes = ms.ToArray();


                ms.Close();
                cs.Close();

                // Place les données chiffrées dans une chaine encodée en Base64

    Tex.WriteLine (Convert.ToBase64String(CipherBytes));

                Console.WriteLine (Convert.ToBase64String(CipherBytes));
            Tex.Close();    


    }
</code></pre>
