private void MergeFolderBtn_Click(object sender, EventArgs e)
        {
            string sourceDerectiony = OpenFolderName.Text.Trim();
            string TargetFile       = SaveFileName2.Text.Trim();

            if (sourceDerectiony.Length <= 0 || TargetFile.Length <= 0)
            {
                MessageBox.Show("SourceFolder or TargetFile is null.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            else if (!Directory.Exists(sourceDerectiony))
            {
                MessageBox.Show("SourceFolder isn't exist.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (File.Exists(TargetFile))
            {
                File.Delete(TargetFile);
            }
            string[] files = Directory.GetFiles(sourceDerectiony, "*.shp");
            if (files.Length <= 1)
            {
                MessageBox.Show("Merge file less 1.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            TimeSpan ts1 = new TimeSpan(DateTime.Now.Ticks); //获取当前时间的刻度数

            ShapeFileFunction.MergeManyShpFile(files, TargetFile);

            TimeSpan ts2      = new TimeSpan(DateTime.Now.Ticks);
            TimeSpan ts       = ts2.Subtract(ts1).Duration();                                                                                               //时间差的绝对值
            String   spanTime = ts.Hours.ToString() + "小时" + ts.Minutes.ToString() + "分" + ts.Seconds.ToString() + "秒" + ts.Milliseconds.ToString() + "毫秒"; //以X小时X分X秒的格式现实执行时间

            MessageBox.Show("合并结束,耗时" + spanTime);
        }
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            try
            {
                ShapeFileFunction.MergeManyShpFile(files, TargetFile, worker, e);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Merge error,error code:" + ex.ToString(), "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }