Everyone here seems to be missing the point that this is a
RichTextBox!
I am assuming that you want to preserve the formatting information that can be entered into the RichTextBox.
Others are also making it way more complex than it needs to be.
Basically, you want to append the information to the file. But, you want to write the RichText, not the Text.
So, the RichTextBox provides a property called Rtf that is the text with the rich text formatting.
If you want to take the original file and append it, just open a stream writer using File.AppendText and then write the text...like so:
using (StreamWriter writer = File.AppendText(@"c:\teste\chat.txt"))
{
writer.Write(richTextBox1.Rtf);
}
it's that simple...