Programming Course in C# ¡Free!

11.08 - ArrayList - Text file reader

 Saturday, April 06, 2013 published by Exercises C#

Deliver here your basic text file reader. 

This text file reader always shows 21 lines of the text file, and the user could use up key to show the previous line, down key to show the next line, and ESC key to exit.

Hints:

The text file reader should have 3 methods: 

- ReadFile (Read the text file and store it in memory)

- ShowMenu (Clear the console and prepare the top line and the bottom line [raw 23] of the console, changing colours using Console.BackgroundColor, Console.ForegroundColor, ConsoleColor and Console.SetCursorPosition(column, raw). Once the menu is prepared, remember to set the cursor in the second raw).

- ShowFrom (write 21 lines, considering the position of the first line to write)

The logic of the main program should be like: ShowMenu, ShowFrom, ReadKey, ShowMenu, ShowFrom, ReadKey....