c# appent to file code example
Example 1: c# append to file
using(StreamWriter writer = new StreamWriter("C:\\log.txt", true))
{
writer.WriteLine("Line");
}
Example 2: streamwriter append text
using (FileStream fs = new FileStream(fileName,FileMode.Append, FileAccess.Write))
using (StreamWriter sw = new StreamWriter(fs))
{
sw.WriteLine(something);
}