using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Exercice2_1 { class Program { /*Énoncé: Écrire un programme qui copie un fichier texte dans un autre et affiche au même temps le contenue du fichier. */ static void Main(string[] args) { string s; StreamReader patrick = new StreamReader("E:/test/exercice.txt"); StreamWriter martin = new StreamWriter("E:/test/sortie.txt"); int numLigne = 0; while (!patrick.EndOfStream) { numLigne++; s = patrick.ReadLine(); Console.WriteLine("Le contenu de laligne {0} est: {1}",numLigne,s); martin.WriteLine(s); } patrick.Close(); martin.Close(); Console.Read(); } } }