Files and Directories

Exercise: Reading from a file with using

Goal

Read from the local file 'Movies.txt'

  1. Create a file stream caleld file with a using statement.
  2. Create a stream reader called reader using the file stream. This block must be nested using block syntax { ... }.
  3. 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.
  4. Write each move to the Console using WriteLine.
Page 14 of 20