using System.Collections.Generic;
static void Main(string[] args)
string file_path = @"C:\testlol\films_result.txt";
Console.WriteLine(DateTime.Now);
List<Film> films = new List<Film>();
if (File.Exists(@"C:\testlol\films_data.txt"))
readfl = new StreamReader(@"C:\testlol\films_data.txt");
Console.WriteLine("File not found");
while (readfl.EndOfStream == false)
s.name = readfl.ReadLine();
s.year = Convert.ToInt16(readfl.ReadLine());
s.duration = Convert.ToInt16(readfl.ReadLine());
s.director = readfl.ReadLine();
if (a == "Да") s.reward = true;
s.type = readfl.ReadLine();
var get_film = from x in films
foreach (var t in get_film) {
Console.WriteLine(t.name + "\t" + t.director + "\t" +
Convert.ToString(t.duration) + "\t");
using (StreamWriter sw = new StreamWriter(file_path, false, System.Text.Encoding.Default))
sw.WriteLine(DateTime.Now);
sw.WriteLine(t.name + " " + t.year + " " + t.duration);