AppendText returns a StreamWriter that appends to an existing file or creates a file if one does not exist code example
Example 1: c# append to file
using(StreamWriter writer = new StreamWriter("C:\\log.txt", true))
{
writer.WriteLine("Line");
}
Example 2: c# append to file
File.AppendAllText(@"c:\path\file.txt", "text content" + Environment.NewLine);