static void Main(string[] args)
        {
            Boolean exit = false;

            // Création de l'ogjet message
            Message message = new Message();

            //Recuperation du message d'accueil
            string msg = message.GetHelloMessage();

            do
            {
                WriteLine(msg);
                WriteLine("pressez \"Enter\" pour reafficher le msg de bienvenue ou taper \"exit\" pour quitter l'app");

                string choice = ReadLine();

                while (choice != "" && choice != "exit")
                {
                    WriteLine("Veuillez entrer une commande valide");
                    choice = ReadLine();
                }

                if (choice == "exit")
                {
                    WriteLine("Aurevoir");
                    exit = true;
                }
            } while (!exit);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            WriteLine("Veuillez saisir l'heure du bonjour");
            String result = ReadLine();
            Int32.TryParse(result, out int choice);

            
            WriteLine("Veuillez saisir l'heure du bon après");
            String result1 = ReadLine();
            Int32.TryParse(result1, out int choice1);

            WriteLine("Veuillez saisir l'heure du bonsoir");
            String result2 = ReadLine();
            Int32.TryParse(result, out int choice2);



            Message msg = new Message(choice, choice1, choice2);
            String message = msg.GetHelloMessage();

            String response = "";

            do
            {
                WriteLine(msg.message + " " + System.Security.Principal.WindowsIdentity.GetCurrent().Name);
                WriteLine("Veuillez saisir \"exit\" pour sortir");
                response = ReadLine();
                            }

            while (!response.Equals("exit"));
                      
                

        }
Exemple #3
0
        static void Main()
        {
            Message message = new Message(new int[] { 7, 15, 23 });

            do
            {
                Console.WriteLine(message.GetHelloMessage());
                Console.Write("Type 'exit' to quit...");
            } while (Console.ReadLine().ToLower() != "exit");
        }
Exemple #4
0
        static void Main(string[] args)
        {
            String exit = "";

            do
            {
                Message message = new Message(9, 13, 18);
                System.Console.WriteLine(message.GetHelloMessage() + " " + Environment.UserName);
                exit = System.Console.ReadLine();
            } while (exit != "exit");
        }
        static void Main(string[] args)
        {
            string line = "";

            do
            {
                if (line == "")
                {
                    Message message = new Message();
                    Console.WriteLine(message.GetHelloMessage());
                }
                else
                {
                    Console.WriteLine("Error try again");
                }

                line = Console.ReadLine();
            }while (line != "exit");
        }