Пример #1
0
 public void SaveToFile(JurnalAfter j, string fileName, bool overwride = false)
 {
     if (overwride || !File.Exists(fileName))
     {
         File.WriteAllText(fileName, j.ToString());
     }
 }
Пример #2
0
        static void Main(string[] args)
        {
            var j = new JurnalAfter();

            j.AddEntry("Tom Hank");
            j.AddEntry("Chevrolet Lacetti");
            Console.WriteLine(j);

            var fm       = new FileManager();
            var fileName = @"C:\Users";

            fm.SaveToFile(j, fileName);
            Process.Start(fileName);
        }