lab6
This commit is contained in:
parent
44c56936ff
commit
55c68c2d70
@ -160,16 +160,20 @@ public class StorageCollection<T>
|
||||
return false;
|
||||
}
|
||||
|
||||
string bufferTextFromFile = "";
|
||||
using (FileStream fs = new(filename, FileMode.Open))
|
||||
{
|
||||
using StreamReader streamReader = new StreamReader(fs);
|
||||
string firstString = streamReader.ReadLine();
|
||||
if(firstString == null || firstString.Length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!firstString.Equals(_collectionKey))
|
||||
{
|
||||
//если нет такой записи, то это не те данные
|
||||
return false;
|
||||
}
|
||||
|
||||
_storages.Clear();
|
||||
while (!streamReader.EndOfStream)
|
||||
{
|
||||
@ -204,7 +208,6 @@ public class StorageCollection<T>
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user