Esempio n. 1
0
        /// <summary>
        /// 选择源文件夹
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSource_Click(object sender, EventArgs e)
        {
            //判断是否选择子文件夹
            if (this.IsContainSubfolder.Checked)
            {
                isContainSubFloder = true;
            }
            else
            {
                isContainSubFloder = false;
            }

            //选择源文件夹
            using (FolderBrowserDialog folder = new FolderBrowserDialog())
            {
                if (folder.ShowDialog() == DialogResult.OK)
                {
                    string sourcepath = folder.SelectedPath;
                    this.tbxSource.Text = sourcepath;
                    fileHelp            = new FileHelp();
                    SelectedRARfiles    = fileHelp.GetRarFiles(sourcepath, isContainSubFloder);
                    InitFileList();
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 是否包含子文件夹中的文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void IsContainSubfolder_CheckedChanged(object sender, EventArgs e)
        {
            if (IsContainSubfolder.Checked)
            {
                isContainSubFloder = true;
            }
            else
            {
                isContainSubFloder = false;
            }
            string path = this.tbxSource.Text;

            if (!Directory.Exists(path))
            {
                MessageBox.Show("请选择源文件夹!");
                return;
            }
            fileHelp         = new FileHelp();
            SelectedRARfiles = fileHelp.GetRarFiles(path, isContainSubFloder);
            InitFileList();
        }