C# 14 · Async, errors and resources
Dispose a resource automatically
A using declaration disposes the object at the end of the enclosing scope.
using var stream = File.OpenRead("data.bin");
C# 14 · Async, errors and resources
A using declaration disposes the object at the end of the enclosing scope.
using var stream = File.OpenRead("data.bin");
Was this page helpful?