title: C# ListBox Import from Text File Crash
body: <p>I am using this code to import text file to my ListBox</p>
  
  <pre><code>        OpenFileDialog openFileDialog1 = new OpenFileDialog();
          openFileDialog1.Filter = "Text Files|*.txt";
          openFileDialog1.Title = "Select a Text file";
          openFileDialog1.FileName = "";
          DialogResult result = openFileDialog1.ShowDialog();
          if (result == DialogResult.OK)
          {
              string file = openFileDialog1.FileName;
  
              string[] text = System.IO.File.ReadAllLines(file);
              foreach (string line in text)
              {
                  listBox2.Items.Add(line);
  
              }
              listBox2.Items.Add("");
          }
  </code></pre>
  
  <p>It works fine for small text files, with 10 lines or so, but when I try to import bigger list, (4-5 megabytes) the program isn't responding and it's crashing.</p>
  
  <p>Any help?</p>