Files and Directories
Exercise: Working with files
Goal
- Create an instance of FileInfo, named file for the path `.\hello-world.txt.
- Using an if statement, check to see if the file exists.
- 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.
- Write the fileName variable to the console using WriteLine.
Page 18 of 20