private void button4_Click(object sender, EventArgs e) { FolderBrowserDialog fd = new FolderBrowserDialog(); fd.Description = "Папка для загрузки файлов"; if (fd.ShowDialog() == DialogResult.OK) { OpenFileDialog opg = new OpenFileDialog(); opg.Filter = "DB File|*.db"; if (opg.ShowDialog() == DialogResult.OK) { var db = DBFile.Read(opg.FileName); progressBar1.Maximum = 0; progressBar1.Value = 0; progressBar1.Style = ProgressBarStyle.Blocks; Sizefiles.Clear(); foreach (var item in db) { //MessageBox.Show(DownloadingPaths.ToPath(setting.URLToHTTPPort) + DownloadingPaths.SD + item.HTTPPath); progressBar1.Maximum += 100; BtnDownload(DownloadingPaths.ToPath(setting.URLToHTTPPort) + DownloadingPaths.SD + item.HTTPPath, fd.SelectedPath + "\\" + item.HTTPPath.Split('/').Where(x => x.Contains(".")).ToArray()[0]); } } } }