private void btnSure_Click(object sender, RoutedEventArgs e)
        {
            FileInfoEntity info = new FileInfoEntity();
            string         path = tbLocalPath.Text;

            info.FilePath    = path.Substring(0, path.LastIndexOf("\\"));
            info.FileName    = path.Substring(info.FilePath.Length + 1, path.Length - info.FilePath.Length - 1);
            info.NewFilePath = "";
            info.NewFileName = tbRomteFile.Text;
            info.FileType    = FileType.Directory;
            if (FtpHelper.CheckExistOfRemoteDirectory("ftp://" + FtpHelper.IP + "/" + (string.IsNullOrEmpty(info.NewFilePath) ? "" : info.NewFilePath + "/") + info.NewFileName))
            {
                System.Windows.MessageBox.Show("目标文件夹已存在");
            }
            else
            {
                this.Close();
                if (MainWindow.uploadForm == null || MainWindow.uploadForm.IsDisposed)
                {
                    MainWindow.uploadForm = new FtpUploadListForm();
                    MainWindow.uploadForm.Init();
                }
                List <FileInfoEntity> subDirList = new List <FileInfoEntity>();
                List <FileInfoEntity> ls         = FtpHelper.TaskInit(info).Where(x => x.FileType == FileType.File).Select(x => { return(x); }).ToList();
                if (ls != null)
                {
                    foreach (FileInfoEntity item in ls)
                    {
                        MainWindow.uploadForm.Add(item);
                    }
                }
                MainWindow.uploadForm.WindowState = FormWindowState.Normal;
                MainWindow.uploadForm.Show();
            }
        }
        private void btnSure_Click(object sender, RoutedEventArgs e)
        {
            FileInfoEntity info = new FileInfoEntity();
            string         path = tbLocalPath.Text;

            info.FilePath    = path.Substring(0, path.LastIndexOf("\\"));
            info.FileName    = path.Substring(info.FilePath.Length + 1, path.Length - info.FilePath.Length - 1);
            info.NewFilePath = "";
            info.NewFileName = tbRomteFile.Text;
            info.FileType    = FileType.Directory;
            if (FtpHelper.CheckExistOfRemoteDirectory("ftp://" + FtpHelper.IP + "/" + (string.IsNullOrEmpty(info.NewFilePath) ? "" : info.NewFilePath + "/") + info.NewFileName))
            {
                System.Windows.MessageBox.Show("目标文件夹已存在");
            }
            else
            {
                this.Close();
                List <FileInfoEntity> subDirList = new List <FileInfoEntity>();
                List <FileInfoEntity> ls         = FtpHelper.TaskInit(info).Where(x => x.FileType == FileType.File).Select(x => { return(x); }).ToList();

                foreach (FileInfoEntity item in ls)
                {
                    FtpTaskUserControl taskControl = new FtpTaskUserControl(item);
                    taskControl.btnRun.Content = item.ResultCode == ResultCode.New ? "Wait" : "Run";
                    taskControl.mainWindow     = mainWindow;
                    mainWindow.TaskSum++;
                    mainWindow.lv.Items.Add(taskControl);
                }
                mainWindow.ReflashUI();
            }
        }