private void button3_Click(object sender, EventArgs e)
        {
            fromfile = this.textBox1.Text;
            FileInfo f = new FileInfo(this.textBox1.Text);
            int size = ((int)f.Length);
            int num = Int32.Parse(this.comboBox1.SelectedItem.ToString());
            step = size / num;
            int position = 0;
            Thread[] threads = new Thread[num];
            for (int i = 0; i < num; i++)
            {
                if (i != num - 1)
                {
                    threads[i] = new Thread(new ParameterizedThreadStart(this.SplitFile));
                    threads[i].Name = "part" + i;
                    threads[i].Start(position);
                    position += step;
                }
            }
            FileStream fs = new FileStream(fromfile, FileMode.Open, FileAccess.Read);
            fs.Position = (num - 1) * step ;
            byte[] bytes = new byte[size - fs.Position];
            fs.Read(bytes, 0, bytes.Length);
            tofile = this.textBox2.Text + @"\" + Path.GetFileName(this.fromfile) + ".part" + (num - 1);
            fs = new FileStream(tofile, FileMode.Create, FileAccess.Write);
            fs.Write(bytes, 0, bytes.Length);
            fs.Flush();
            fs.Close();
        }        private void SplitFile(Object position)
        {
            byte[] bytes = new byte[step];
            FileStream fs = new FileStream(fromfile, FileMode.Open, FileAccess.Read);
            fs.Position = (int)position;
            fs.Read(bytes, 0, step);
            tofile = this.textBox2.Text + @"\" +Path.GetFileName(this.fromfile) + "."+ Thread.CurrentThread.Name;
            fs = new FileStream(tofile, FileMode.Create, FileAccess.Write);
            fs.Write(bytes, 0, bytes.Length);
            fs.Flush();
            fs.Close();
        }private void button7_Click(object sender, EventArgs e)
        {
            Thread[] threads = new Thread[files.Length];
            target = this.textBox4.Text + @"\" + (Path.GetFileName(files[0])).Substring(0, (Path.GetFileName(files[0])).LastIndexOf('.'));
            int position = 0;
            for (int i = 0; i < files.Length; i++)
            {
                FileInfo f = new FileInfo(files[i]);
                threads[i] = new Thread(new ParameterizedThreadStart(this.CreateNew));
                threads[i].Name = "" + i;
                threads[i].Start(position);
                position += (int)f.Length;
            }
        }        private void CreateNew(Object position)
        {
            FileStream fs = new FileStream(files[(Int32.Parse(Thread.CurrentThread.Name))], FileMode.Open, FileAccess.Read);
            byte[] bytes = new byte[(int)fs.Length];
            fs.Read(bytes,0,bytes.Length);
            fs = new FileStream(target, FileMode.OpenOrCreate, FileAccess.Write);
            fs.Position = (int)position;
            fs.Write(bytes, 0, bytes.Length);
            fs.Flush();
            fs.Close();
        }
上面的是切割,下面的是合并,切割运行后没问题,但是合并出来的文件顺序不对,是不是有必要要加同步,请大家指教.