using System.IO; namespace FileHandling { class Program { static void Main(string[] args) { string filePath = @"C:\Users\User\Documents\example.txt"; FileInfo fileInfo = new FileInfo(filePath); // Creates a new file with the given text fileInfo.AppendText("Hello World!"); // Appends additional text to the file fileInfo.AppendText("\nThis is a new line."); } } }In the above example, we use the FileInfo class to access the file system and create a new file or append to an existing file. The AppendText method takes in a string parameter that is added to the end of the file. This method is part of the System.IO namespace, which is included in the C# standard library.