public static string[] FileContent(string filePath) { //checks to see if file exist. will continue asking until path in correct. while (!File.Exists(filePath)) { ScreenInteractions.FileDoesNotExist(); filePath = ScreenInteractions.ScreenMessagesInput(); } FilePath = filePath; return(File.ReadAllLines(@filePath)); }
static void Main(string[] args) { try { //gets file path string filePath = ScreenInteractions.ScreenMessagesInput(); //gets content inside of file string[] readText = ReadFile.FileContent(filePath); //parse file ParseFile.ParseValue(readText); //End of program ScreenInteractions.ProgramHasCompleted(); Console.ReadLine(); } catch (Exception ex) { ScreenInteractions.ErrorOnProcess(ex); } }