Borschevskaya A.A. Lab Work 7 #9

Closed
pgirl1 wants to merge 12 commits from lab7 into lab6
Showing only changes of commit 242f4cedf1 - Show all commits

View File

@ -109,14 +109,14 @@ namespace ArmoredCar
{
if (!File.Exists(filename))
{
return false;
throw new FileNotFoundException("Файл не найден");
}
using (FileStream f = new(filename, FileMode.Open))
using (StreamReader sw = new(f, Encoding.UTF8))
{
if (!sw.ReadLine().Contains("MapsCollection"))
return false;
throw new FileFormatException("Формат данных в файле не правильный");
string? line;
_mapStorages.Clear();
while ((line = sw.ReadLine()) != null)