//Where is button 1? This seem to be the same as button15. Remove it if it's a mistake. private void button1_Click(object sender, EventArgs e) { progressBar1.Maximum = Directory.GetDirectories(@workDir.Text + @"\extract").Count(); progressBar1.Value = 0; StuffFile s = new StuffFile(); foreach (string StuffDir in Directory.GetDirectories(@workDir.Text + @"\extract")) { progress.Text = "Current file: " + StuffDir + ".stuff"; Application.DoEvents(); s.Archive(@StuffDir, @eveDir.Text + @"\" + Path.GetFileName(StuffDir) + ".stuff"); progressBar1.Value++; } progress.Text = "Idle"; }
private void button15_Click(object sender, EventArgs e) { progressBar1.Maximum = Directory.GetDirectories(@workDir.Text + @"\extract").Count(); progressBar1.Value = 0; StuffFile s = new StuffFile(); foreach (string StuffDir in Directory.GetDirectories(@workDir.Text + @"\extract")) { progress.Text = "Current file: " + StuffDir + ".stuff"; Application.DoEvents(); foreach (ListViewItem StuffArchive in stuffFiles.SelectedItems) { if (Path.GetFileName(StuffArchive.SubItems[0].Text) == Path.GetFileName(StuffDir) + ".stuff") { s.Archive(@StuffDir, @destDir.Text + @"\" + Path.GetFileName(StuffDir) + ".stuff"); } } progressBar1.Value++; } progress.Text = "Idle"; }