我正在做一个在文本框中显示问题的项目。在每一个下面有 4 个复选框,用户必须选择一个回答问题的复选框。
有什么办法可以将我所有的问题、答案等放在一个 .txt 文件中并从那里加载它们?我不想case
为每个问题都写一个(我大约有 120 个问题)。
到目前为止我的做法:
case 5: // Multiple Answers
txtQuestion.Text = "What are the characteristics of the " +
"Main method? (Choose two)";
grpSingleChoice.Visible = false;
grpMultipleChoice.Visible = true;
chkAnswer1.Text = "A. It must always return void";
chkAnswer2.Text = "B. It is always the first method inside the " +
"main class of a program";
chkAnswer3.Text = "C. It is the start and end point of a program";
chkAnswer4.Text = "D. It must always be passed an array of strings " +
"as in static void Main(string[] args)";
chkAnswer5.Visible = true;
chkAnswer5.Text = "E. It must be created inside of a class" +
"or a structure";
break;