Given a file, and we have to read text from the file and append the text in another file using C# program.
File.AppendAllText()
This is a method of "File" class, it is used to append given 'content' to the file which is specified by the 'path'.
Syntax:
void File.AppendAllText(path, content);
Parameters:
- path - Filename with its location.
- content - Text to be written into file.
-
Program:
Output
Note: In above program, we need to remember, when we use "File" class, System.IO namespace must be included in the program.