I would like to create a .txt file and write to it, and if the file already exists I just want to append some more lines:
string path = @\"E:\\AppServ\\Examp
File.AppendAllText adds a string to a file. It also creates a text file if the file does not exist. If you don't need to read content, it's very efficient. The use case is logging.
File.AppendAllText("C:\\log.txt", "hello world\n");