title: How to catch a "FileNotFoundException" exception?
body: <p>I am pretty new to programming and am trying to figure out how to to catch the error "FileNotFoundException." My code is suppose to search for the existing text document (from what is typed into the text box)and load it to my listbox1. I got this problem solved. However, a new problem has arisen! If the user inputs the wrong name/numbers it just crashes the application with the error that it couldn't find the file. Is there any way to get the program to display an error message "File not found." or simply not crash the entire program? Thanks in advance!</p>
  
  <pre><code>     private void btnEnter_Click(object sender, EventArgs e)
      {   
          FileInfo file = new FileInfo(txtExisting.Text + ".txt");
          StreamReader stRead = file.OpenText();
          while (!stRead.EndOfStream)
          {
              listBox1.Items.Add(stRead.ReadLine()); 
          }  
      }
  </code></pre>