Regularly report progress of a BackgroundWorker
问题 I'm writing a music player. This is the (early) code that adds a directory to the playlist: private void SelectFolderButton_Click(object sender, EventArgs e) { int count = 0; AddFolderDialog.ShowDialog(); if(AddFolderDialog.SelectedPath != string.Empty) { BackgroundWorker bgw = new BackgroundWorker(); bgw.DoWork += (a,b) => playlist.AddFolder(AddFolderDialog.SelectedPath, RecursiveCheckBox.Checked, out count); bgw.RunWorkerAsync(); bgw.RunWorkerCompleted += (a, b) => mainStatusLabel.Text =