title: Reading from a text file using C#
body: <p>So I'm making a chat program but I am having issues creating a new line in the text box instead of overwriting the other message. Here is my code:</p>
  
  <pre><code>        private void refreshRate_Tick(object sender, EventArgs e)
          {
          String ChatPath = @"Path";
          String line;
          try
          {
              StreamReader sr = new StreamReader(@"Path");
              line = sr.ReadLine();
              richTextBox1.Text = null;
              while (line != null)
              {
                  richTextBox1.AppendText(Environment.NewLine);
                  richTextBox1.Text = line;
                  line = sr.ReadLine();
              }
              sr.Close();
          }
          catch (Exception r)
          {
              Console.WriteLine("Exception: " + r.Message);
          }
          finally
          {
          }
      }
  </code></pre>