Пример #1
0
        public void func1(int tail)
        {
            int        Minloc = 0;
            int        start = 0, end, SepNum;
            string     EndStr = "";
            TxtIO      TxtW   = new TxtIO();
            TxtDispose TxtDp  = new TxtDispose();

            SepSize = TxtDp.UpDateSep(FileSize, SepSize, tail);
            Minloc  = TxtDp.MinLocation(SepSize);
            end     = Minloc;
            SepNum  = TxtDp.DivNum(FileSize, SepSize);
            for (int i = 1; i <= SepNum; i++)
            {
                while (!TxtDp.SepEnd(EndStr, SepSize))
                {
                    EndStr = str.Substring(start, end);
                    end++;
                }
                TxtW.TxtWrite("Div" + i + ".txt", EndStr);
                EndStr = "";
                start  = start + end + 1;
                end    = Minloc;
                if (str.Substring(start, str.Length - start).Length < SepSize)
                {
                    TxtW.TxtWrite("Div" + (i + 1) + ".txt", str.Substring(start, str.Length - start));
                    break;
                }
            }
        }
Пример #2
0
        public TxtDivFunc1(string FilePath, int DivSize)
        {
            TxtIO TxtIO = new TxtIO();

            str      = TxtIO.TxtRead(FilePath);
            FileSize = TxtIO.FileSize(FilePath);
            SepSize  = DivSize;
        }
Пример #3
0
        private void Btn_Click(object sender, RoutedEventArgs e)
        {
            TxtIO       TxtR  = new TxtIO();
            TxtDispose  TxtDp = new TxtDispose();
            TxtDivFunc1 Func1 = new TxtDivFunc1("TextFile.txt", 32800);

            TxtBox.Text = TxtR.TxtRead("TextFile.txt");
            TxtBlk.Text = TxtR.FileSize("TextFile.txt").ToString();
            Func1.func1(2);
        }