[nfbcs] Reading text files c# and exceptions

Taylor Arndt taylorarndt99 at gmail.com
Mon Dec 12 03:11:27 UTC 2016


Hi,
So i am trying to read a file and i get a exception when  i am doing it
using System;
using System.IO;

namespace text_file_reading_practice
{
    class Program
    {
        private static object file;
        private static object reader;

        static void Main(string[] args)
        {

            string line;
            using (StreamReader reader = new
StreamReader("TriviaGameQuestions.txt"))
            {
                line = reader.ReadLine();
            }
            Console.WriteLine(line);

        Console.ReadLine();

        }



    }
}


-- 
Taylor




More information about the NFBCS mailing list