public override void Load() { try { if (File.Exists("listInformationOfDay.txt")) { List <InformationOfDay> list = new List <InformationOfDay>(); StreamReader file = File.OpenText("listInformationOfDay.txt"); string[] data = new string[14]; string[] date = new string[3]; string[] timeSleepMor = new string[4]; string[] timeSleepAft = new string[4]; string line; InformationOfDay info; do { line = file.ReadLine(); if (line != null && line.Length > 1) { data = line.Split('|'); date = data[2].Split(','); timeSleepMor = data[9].Split(','); timeSleepMor = data[11].Split(','); info = new InformationOfDay(Convert.ToInt32(data[0]), Convert.ToInt32(data[3]), Convert.ToInt32(data[4]), Convert.ToInt32(data[5]), data[12], data[13], Convert.ToInt32(data[6]), Convert.ToInt32(data[7]), Convert.ToInt32(data[8]), Convert.ToInt32(data[10])); info.AddTimeSleepMor(Convert.ToInt32(timeSleepMor[0]), Convert.ToInt32(timeSleepMor[1]), Convert.ToInt32(timeSleepMor[2]), Convert.ToInt32(timeSleepMor[3])); info.AddTimeSleepAft(Convert.ToInt32(timeSleepAft[0]), Convert.ToInt32(timeSleepAft[1]), Convert.ToInt32(timeSleepAft[2]), Convert.ToInt32(timeSleepAft[3])); info.AddDaySave(Convert.ToInt32(date[0]), Convert.ToInt32(date[1]), Convert.ToInt32(date[2])); info.SetMeal(data[1]); list.Add(info); } } while (line != null); file.Close(); listInfo = list; } else { listInfo = new List <InformationOfDay>(); } } catch (IOException e) { Console.WriteLine("Eror: " + e.Message); } }