Ejemplo n.º 1
0
        public void Load(QuestionList list)
        {
            _list = list;
            _list.Clear();

            FileStream FileToLoad = new FileStream(@_path, FileMode.Open, FileAccess.Read);
            StreamReader Reader = new StreamReader(FileToLoad, System.Text.Encoding.Default);

            Question tmp = new Question();

            for (int i = 0; i < 15; i++)
            {
                tmp = new Question();
                tmp.Question_ = Reader.ReadLine();

                for (int j = 0; j < 4; j++)
                    tmp.Set_Answer(j, Reader.ReadLine());

                _list.Add(tmp);
            }

            Reader.Close();
            FileToLoad.Close();
        }