Files and Directories
Exercise: Reading from a file with using
Goal
Read from the local file 'Movies.txt'
- Create a file stream caleld file with a using statement.
- Create a stream reader called reader using the file stream. This block must be nested using block syntax { ... }.
- While we are not at the end of the stream, create a local string declaration named movie and assign this the value of the next line from the file.
- Write each move to the Console using WriteLine.
Page 14 of 20