Ejemplo n.º 1
0
 static void Main(string[] args)                                                                                                                                                                         //				                ***
 {                                                                                                                                                                                                       //                           *       *
     try                                                                                                                                                                                                 //                         *           *
     {                                                                                                                                                                                                   //                        *   Matias    *
         Sovellus.Aja();                                                                                                                                                                                 //                       *    Puputti    *
     }                                                                                                                                                                                                   //                       *    NEA18SPC   *
     catch (Exception i)                                                                                                                                                                                 //                       *    27.3.2019  *
     {                                                                                                                                                                                                   //                        *             *
         WriteLine("Ohjelman suoritus päättyi virheeseen.");                                                                                                                                             //                         *           *
         WriteLine($"Virhe:{i.Message}");                                                                                                                                                                //                           *       *
     }                                                                                                                                                                                                   //                              ***
     WriteLine("Paina Enter lopettaaksesi...");
     ReadLine();
 }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     try
     {
         Sovellus.Aja();
     }
     catch (Exception virhe)
     {
         WriteLine("Ohjelman suoritus pättyi virheeseen.");
         WriteLine($"VIRHE: {virhe.Message}");
     }
     finally
     {
         Write("Paina Enter lopettaaksesi...");
         ReadLine();
     }
 }
Ejemplo n.º 3
0
 static void Main(string[] args)
 {
     //Kutsutaan Sovellus.Aja
     try
     {
         Sovellus.Aja();
     }
     //Jos suorituksen aikana nostetaan poikkeus, tulostetaan allaolevat tekstirivit
     catch (Exception e)
     {
         WriteLine("Ohjelman suoritus päättyi virheeseen.");
         WriteLine($"Virhe: {e.Message}");
         ReadKey();
     }
     WriteLine();
     WriteLine("Paina Enter lopettaaksesi...");
     ReadLine();
 }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            //Suoritetaan ohjelma vikasietoisesti
            try
            {
                WriteLine("Noppa-peli");
                Sovellus.Aja();
            }

            catch (Exception e)
            {
                WriteLine("Ohjelman suoritus päättyi virheeseen.");
                WriteLine($"Virhe: {e.Message}");
            }

            finally
            {
                WriteLine("Paina Enter lopettaaksesi...");
                ReadLine();
            }
        }