add text to file c# code example
Example 1: asp.net c# write string to text file
using (StreamWriter writer = new StreamWriter("email.txt", true)) //// true to append data to the file
{
writer.WriteLine("your_data");
}
Example 2: c# append to file
File.AppendAllText(@"c:\path\file.txt", "text content" + Environment.NewLine);