backgroundWorker 
Thread thread = new Thread(new ThreadStart(fun));
thread.Start();private void fun()
    {
      Thread.CurrentThread.Abort();
    }    private void test(int value)
    {
      if (this.InvokeRequired)
      {
        this.Invoke(new ProgressBarShow(test), value);
      }
      else
      {
        this.progressBar1.Value = value;
        this.label1.Text = value + "%";
      }
    }