C Sharp (C#) - File IO
Which of the following is the correct syntax to open a file for reading using a
using statement in C#?using statement in C#?using block syntaxusing statement requires parentheses around the resource declaration and a block of code inside braces.using (var fs = new FileStream(...)) { } which is correct. using var fs = FileStream("file.txt", FileMode.Open); misses parentheses. using FileStream fs = new FileStream("file.txt", FileMode.Open); misses braces. using (FileStream fs = FileStream.Open("file.txt")) { } uses a non-existent method FileStream.Open.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions