C# 14 · Async, errors and resources
Read and write files
Read and write text asynchronously.
var text = await File.ReadAllTextAsync("data.txt");
await File.WriteAllTextAsync("copy.txt", text);
C# 14 · Async, errors and resources
Read and write text asynchronously.
var text = await File.ReadAllTextAsync("data.txt");
await File.WriteAllTextAsync("copy.txt", text);
Was this page helpful?