title: how to stop backgroundworker while running
body: <p>I am new to c sharp .
  I have created an windows form application .
  my application works fine.
  i want to cancel the BackgroundWorker while running. i mean i want to completely stop the BackgroundWorker Process.
  I am using this code to cancel the application,
  1 )first i used  </p>
  
  <pre><code>    private void exitToolStripMenuItem_Click(object sender, EventArgs e)
      {
  
          this.Dispose();
      }
  </code></pre>
  
  <p>but it doesnot stop . then i used </p>
  
  <pre><code>    private void exitToolStripMenuItem_Click(object sender, EventArgs e)
      {
          bgBackfill1.CancelAsync();
          this.Dispose();
      }
  </code></pre>
  
  <p>but when i exit the application it writes the files in G:\Drive .
  can anyone please say me how can i stop writing the files in G:\Drive and stop the BackgroundWorker Process Completely.</p>
  
  <p>Thanks if someone Helps me.</p>