Good day to all. Help me figure it out, I wrote an application that records a binary file, but only writes 101 values, what could be the problem?
public void Cicle() { SectionHelper helper = new SectionHelper(); var Number_s = helper.AllocatedSection(8); var Year_s = helper.AllocatedSection(8); var Shift_s = helper.AllocatedSection(3); var Day_s = helper.AllocatedSection(5); var Month_s = helper.AllocatedSection(4); var R_s = helper.AllocatedSection(4); // пока не понял что за параметр. Int32 Line = 0; Int32 Line2 = 0; int Year2 = 0; int Day2 = 0; int Month2 = 0; int Shift2 = 0; int Rs2 = 0; int Number2 = 0; int NumberR = -1; string path = @"E:\DELETE\n.dat"; string path2 = @"E:\DELETE\nr.dat"; try { using (BinaryReader reader = new BinaryReader( File.Open( path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))) { using (BinaryReader reader2 = new BinaryReader( File.Open( path2, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))) { while (reader.PeekChar() > -1) { Nr++; Line = reader.ReadInt32(); BitVector32 bv = new BitVector32(Line); int Number = bv[Number_s]; int Year = bv[Year_s]; int Shift = bv[Shift_s]; int Day = bv[Day_s]; int Month = bv[Month_s]; int Rs = bv[R_s]; if (reader2.PeekChar() > -1) { Line2 = reader2.ReadInt32(); BitVector32 bv2 = new BitVector32(Line2); Number2 = bv2[nr_s]; Year2 = bv2[y_s]; Shift2 = bv2[sm_s]; Day2 = bv2[d_s]; Month2 = bv2[m_s]; Rs2 = bv2[r_s]; } Console.WriteLine("Начальный параметр Line {0}", Line); if ((Line != Line2) & (Year > 14)) { using (BinaryWriter WriteNr = new BinaryWriter( File.Open( path2, FileMode.Append, FileAccess.Write, FileShare.ReadWrite) )) { WriteNr.Write(Line); //WriteNr.Close(); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("Запись в Nr Line:{0} И Line2:{1}", Line, Line2); Console.ResetColor(); } ReadSr _readSr = new ReadSr( Line2, Year2, Day2, Month2, Shift2, Nr2); if ((_readSr.NumberZ == NumberR) & (_readSr.flag)) { } else { ReadSr _readSr2 = new ReadSr( Line, Year, Day, Month, Shift, Nr); { if (_readSr2.flag) { SaveBinaryNumb save = new SaveBinaryNumb( _readSr2.NumberZ, _readSr2.TimeRelease, _readSr2.NumberRoll); } } } } } And the most interesting file in the dimension grows, and continues to grow until you close the program, and so alas it should not be, because there is a comparison of data from one file with another file, and if there are coincidences, then skip performing any actions. help me please