Answers for "c# how to write to a file"

C#
0

c# how to write to a file

using System.IO;
using System.Threading.Tasks;

class WriteAllLines
{
    public static async Task ExampleAsync()
    {
        string[] lines =
        {
            "First line", "Second line", "Third line" 
        };

        await File.WriteAllLinesAsync("WriteLines.txt", lines);
    }
}
Posted by: Guest on May-30-2021

C# Answers by Framework

Browse Popular Code Answers by Language