Files and Directories

Exercise: Working with files

Goal
  1. Create an instance of FileInfo, named file for the path `.\hello-world.txt.
  2. Using an if statement, check to see if the file exists.
  3. If the file does exist, create a new string variable named fileName and assign it the value using the correct Pathmethod, using the FullName property of your FileInfo instance.
  4. Write the fileName variable to the console using WriteLine.
Page 18 of 20