There is a file, let it be Script.ps1 powershell. I need to consider it as parts and with each part produce some (add to another file remotely). The size of one part is valid 1Kb. I understand how to do it, but something doesn’t work out for me at all, please help. Approximate code
byte[] buffer; int size = 1024; FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read); { buffer = new byte[size]; int count; int sum = 0; while ((count = fileStream.Read(buffer, sum, size - sum)) > 0) { sum += count; //Дальше преобразую buffer в строку и уже пытаюсь работать со строкой } } Tried to do, too, through the number of pieces
long file_count = filestrim.Length / size; //дальше в цикле запускаю считывание but either I don’t move the carriage, or I prescribe it incorrectly, it doesn’t work as it should (