Esempio n. 1
0
 static void ShowMenuItem(TriviaQuestion Questions, int count)
 {
     Console.WriteLine();
     Console.WriteLine("{0}.   {1}", count, Questions.GetQuestion());
     Console.WriteLine("     1.  {0}", Questions.GetQuestion1());
     Console.WriteLine("     2.  {0}", Questions.GetQuestion2());
     Console.WriteLine("     3.  {0}", Questions.GetQuestion3());
     Console.WriteLine("     4.  {0}", Questions.GetQuestion4());
     Console.WriteLine("Current answer: {0}", Questions.GetAnswer());
     Console.WriteLine();
 }
Esempio n. 2
0
 static void SaveFile(string filename, List <TriviaQuestion> Questions)
 {
     try
     {
         using (StreamWriter fout = new StreamWriter(filename))
         {
             for (int index = 0; index < Questions.Count; index++)
             {
                 TriviaQuestion temp = Questions[index];
                 fout.WriteLine("{0},{1},{2},{3},{4},{5}", temp.GetQuestion(), temp.GetQuestion1(), temp.GetQuestion2(), temp.GetQuestion3(), temp.GetQuestion4(), temp.GetAnswer());
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine("File save failed for: {0}", filename);
     }
 }