title: how to speed up foreach results
body: <p>I am making a Windows Forms application, and I want to generate numbers from 0 to 99999.
  I use the following code to print these numbers:</p>
  
  <pre><code>  private void button1_Click(object sender, EventArgs e)
      {
          int[] arr = Enumerable.Range(0, 99999).ToArray();
          var sb = new StringBuilder();
          foreach (int a in arr)
          {
              sb.AppendLine(a.ToString("000000"));
             // textBox3.Text += a.ToString("000000")+Environment.NewLine;
              textBox3.Text = sb.ToString();
  
          }
      }
  </code></pre>
  
  <p>But it takes lots of time to print all the numbers.</p>
  
  <p>Is there any way to speed this up? </p>