Eingaben in der Konsole in einem Text Dokument speichern, wie?

1 Antwort

using System.IO;

using System.Threading.Tasks;

class WriteAllText

{

  public static async Task ExampleAsync()

  {

    string text =

      "A class is the most powerful data type in C#. Like a structure, " +

      "a class defines the data and behavior of the data type. ";

    await File.WriteAllTextAsync("WriteText.txt", text);

  }

}

https://docs.microsoft.com/de-de/dotnet/csharp/programming-guide/file-system/how-to-write-to-a-text-file#write-one-string-to-a-file