Hello everyone I am trying to create a program that allows me to set up a test with simple answers while being able to insert .txt files to check to see if they are correct or not. It’s something very simple for most but for me I want to know how to insert a .txt file and create a .txt file that has all the correct answers on it so I can check to see whether the answers are correct or not. Also I am using Microsoft Visual Studio 2019. Any advice or videos that can help me create the array and coding also helps. Please and thank you for your help!!
You’ll probably want a StreamReader to read the file line by line in a loop as shown on this page.
Reading the file is only a part of the solution, but I’m not going to provide you with the whole solution. Is suggest creating a class to represent a question, creating a List<> based on that class, and filling the list inside a loop. If there’s a specific part of that you need help with then please make a new post describing where you’re stuck, and shoe what you’ve tried already. Good luck!
Oh thank you also I am quite new to C# so how would I transfer the answers to show that they are correct to a Text Box when i create one and label it?
C# devs
null reference exceptions