Исправить чтение C#

Мне нужно чтобы у меня читало 1 раз, в строке 31, вроде это проще, мне сказали это сделать, хотя и так все норм. Помогите пожалуйста. Функция public string getAnswer(string FileNameKey, string qwestion). И string[] massline сделать классом, он там же в той функции.

ChatBot.cs
 
namespace ChatBotXaml
{
     
    public class ChatBot
    {
        protected String UserName;//Хранит имя заданное пользователем при первом запуске.
                                  //при каждом запуске. Загружать имя в эту переменную из файла.
        private String _txtBlock;//Хранит историю сообщений
 
        public string TxtBlock
        {
            get { return _txtBlock; }
            set { _txtBlock = value; }
        }
        
        // Задаёт имя пользователя 
        public void SetUsName(string name)
        {
            this.UserName = name;
        }
 
        // Выход: имя пользователя
        public string GetUsName()
        {
            return this.UserName;
        }
        // читать 1 раз
        // Обрабатывает запрос. Выход: ответ на вопрос
//////////////////////////////       
public string getAnswer(string FileNameKey, string qwestion)
        {
            string str, res="";
            int c;
            bool flag = false;
 
            qwestion = qwestion.ToLower();
            //
            string[] massline = File.ReadAllLines(FileNameKey, Encoding.GetEncoding(1251));
                for (int f = 0; f < File.ReadAllLines(FileNameKey).Length; f++)
                {
                    str = massline[f];
                    if (str.Contains(qwestion))
                    {
                    flag = true;
                        for (int i = 0; i < str.Length; i++)
                        {
                            if (str[i] == '{')
                            {
                                c = i + 1;
                                while (str[c] != '}')
                                {
                                    res += str[c];
                                    c++;
                                }
                            }
                        }
                    }
                }
 
            if (flag)
            {
                return res;
            }
            else
                throw new Exception("Команда не найдена");
        }
///////////////////////////////////////    
        // Форматирует текст ответа для textBox
        public string ResponseOutput(string answer)
        {
            string str, timeStr;
            DateTime dt = System.DateTime.Now;
            timeStr = dt.ToString("HH:mm");
            str = timeStr + "\n" + "Bot: " + answer + "\n";
            return str;
        }
 
        // Форматирует текст пользователя для вывода в TextBlock
        public string UserOutput (string text)
        {
            string str, timeStr;
            DateTime dt = System.DateTime.Now;
            timeStr = dt.ToString("HH:mm");
            str = timeStr + "\n" + this.UserName + ": " + text + "\n";
            return str;
        }
 
        // Сохранение данных
        public void SaveData (string FileName)
        {
            using (FileStream File = new FileStream(FileName, FileMode.Create))
            {
                using (StreamWriter FileStream = new StreamWriter(File))
                {
                    FileStream.WriteLine(TxtBlock);
                }
            }
        }
 
        // Считывает и возращает значения файла (для вывода истории при запуске)
        public void getData(string FileName)
        {
            using (StreamReader File = new StreamReader(FileName))
            {
                TxtBlock = File.ReadToEnd();
            }
        }
 
        // Считывает и обрабатывает строку формата:"/умножить 10 на 14"
        public double mult(string str)
        {
            double a, b;
            string[] words = str.Split(' ');
            a = Convert.ToDouble(words[1]);
            b = Convert.ToDouble(words[3]);
            return a * b;
        }
 
        // Открывает .exe файл
        public string OpenExe(string str)
        {
            string[] words = str.Split(' ');
            words[1] += ".exe";
            
            if (File.Exists(words[1]) == false)
            {
                Process.Start(words[1]);
                return "Секундочку";
            } 
            else
            {
                return "Файл не найден";
            }
        }
 
        // Функция обработки вопросов, задаваемых боту.
        public void PressBut(string Question)
        {
            if (Question.Length != 0)//проверка: введено ли что-то в поле
            {
                //сложная команда начанается с "/"
                if (Question[0] == '/')
                {
                    //questionBuff = questionBuff.ToLower();
                    if (Question.Contains("умножить") || Question.Contains("умножь"))
                    {
                        _txtBlock += UserOutput(Question);
                        _txtBlock += ResponseOutput(Convert.ToString(mult(Question)));
                    }
                    else if (Question.Contains("открой"))
                    {
                        _txtBlock += UserOutput(Question);
                        _txtBlock += ResponseOutput(OpenExe(Question));
                    }
                    else if (Question.Contains("сброс"))
                    {
                        _txtBlock = UserOutput(Question);
                        _txtBlock += ResponseOutput("Выполнено");
                    }
                }
                else
                {
                    try //проверка на наличие ответа в файле.
                    {
                        _txtBlock += UserOutput(Question);
                        _txtBlock += ResponseOutput(getAnswer("TestKey.txt", Question));
                    }
                    catch
                    {
                        _txtBlock += UserOutput(Question);
                        _txtBlock += ResponseOutput("Команда не найдена");
                    }
                }
 
            }
        }
 
    }
}

Ответы (0 шт):