Tuesday, December 3, 2019

using statements in C# 8 have a bit more variations

using FileStream f = new FileStream(@"C:\users\jaredpar\using.md");

Per this cheatsheet is legit, and you can just use f and eventually f will dispose. The f lives until the close curly brace around it.

No comments:

Post a Comment