title: Updating a Label with the backgroundworker progress
body: <p>I am reading line by line console of an external exe with the help of a backgroundworker, i am assigning each line of console to a label. the problem is the label is not updating with the console line. code is given below</p>
  
  <pre><code>private void bgWorker_DoWork(object sender, DoWorkEventArgs e)
  {
      int i = 0;
      ProcessStartInfo startInfo = new ProcessStartInfo();
      startInfo.CreateNoWindow = true;
      startInfo.UseShellExecute = false;
      startInfo.FileName = EXELOCATION;
      startInfo.WindowStyle = ProcessWindowStyle.Hidden;
      startInfo.Arguments = Program.path;
      startInfo.RedirectStandardOutput = true;
      try
      {
          // Start the process with the info we specified.
          // Call WaitForExit and then the using statement will close.
          using (exeProcess = Process.Start(startInfo))
          {
              using (StreamReader reader = exeProcess.StandardOutput)
              {
                  string result;
                  while ((result = reader.ReadLine()) != null)
                  {
                      // object param = result;
  
                      e.Result = result;
                      bgWorker.ReportProgress(i++);
                  }
              }
          }
      }
      catch
      {
          // Log error.
      }
  }
  
  private void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
  {
      label.Text = e.ToString();
      label.Refresh();
  }
  </code></pre>
  
  <p>how can i solve this issue</p>