← Back to context

Comment by SigmundA

3 years ago

In .Net/C# this is done with IDisposable and the using statement which works quite well.

Ex:

  using (var sr = new StreamReader(filename))
  {
     txt = sr.ReadToEnd();
  }

https://learn.microsoft.com/en-us/dotnet/api/system.idisposa...