Exemplo n.º 1
0
        public void FileDataProcessing()
        {
            string[] fileContent = FilesUtility.ReadFromFile(PathToFile);
            Visits.Clear();

            foreach (string line in fileContent)
            {
                var objectVisit = line.Split(',');
                if (int.TryParse(objectVisit[1], out int age))
                {
                    AddVisit(objectVisit[0], age);
                }
                else
                {
                    Console.WriteLine("String could not be parsed.");
                }
            }
        }
Exemplo n.º 2
0
 public void CreateFile()
 {
     FilesUtility.CreateDirectory(Path.Combine(pathToDesktop, directory));
     FilesUtility.CreateFile(PathToFile, Visits);
 }