fix with streamreader
This commit is contained in:
parent
6ead695eac
commit
3914bd51bb
@ -130,7 +130,7 @@ namespace AntiAircraftGun.Generics
|
|||||||
|
|
||||||
foreach (var zenit in _collection.GetZenits())
|
foreach (var zenit in _collection.GetZenits())
|
||||||
{
|
{
|
||||||
// TODO: Получение объекта
|
|
||||||
T? obj = zenit;
|
T? obj = zenit;
|
||||||
|
|
||||||
if (obj != null)
|
if (obj != null)
|
||||||
|
@ -129,10 +129,15 @@ namespace AntiAircraftGun.Generics
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
using FileStream fs = new(filename, FileMode.Create);
|
string toWrite = $"CarStorage{Environment.NewLine}{data}";
|
||||||
byte[] info = new
|
var strs = toWrite.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
UTF8Encoding(true).GetBytes($"CarStorage{Environment.NewLine}{data}");
|
using (StreamWriter sw = new(filename))
|
||||||
fs.Write(info, 0, info.Length);
|
{
|
||||||
|
foreach (var str in strs)
|
||||||
|
{
|
||||||
|
sw.WriteLine(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user