I am new to c sharp. I created a windows form application. my application is working fine. I want to cancel BackgroundWorker while working. I want to completely stop the BackgroundWorker process. I use this code to cancel the application, 1) first I used
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Dispose();
}
but he does not stop. then i used
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
bgBackfill1.CancelAsync();
this.Dispose();
}
but when I exit the application, it writes files to G: \ Drive. can someone tell me how can I stop writing files to G: \ Drive and complete the BackgroundWorker process completely.
Thanks if someone helps me.
source
share