This is the code i use to create the text file.
System.IO.File.WriteAllLines(@"C:\Users\****\Desktop\File.txt", array);
How do I append text to an existing file?
The other answers have shown you how to append a single string to a text file. If you naturally have a collection of lines, however, you probably want File.AppendAllLines
:
File.AppendAllLines(@"C:\Users\****\Desktop\File.txt", array);
See more on this question at Stackoverflow