using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ReadCarExemple
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            int codeRead = 0;
            do
            {   
                codeRead = Console.Read(); //lit 1 car dans le buffer
                if (codeRead != 0) 
                {
                    Console.WriteLine("code{0:X},{1}",codeRead, (char) codeRead); // affiche le car
                }
            } while (codeRead != 'r'); //
            Console.ReadKey();
        }
    }
}
