0

I'm making a multiple questions quiz on the console application. What I am trying to complete right now is the updating/deleting of questions.

I would really appreciate any help and also note that I'm new so if I have missed anything please let me know as I am not familiar with Stack Overflow.

I would prefer to use streamreader and writer to read and write to the file as I am a little familiar with these.

Here is my code structure for the variables to be saved in the textfile.

public struct Questions
    {
        public int 
               Level,               //1
               Qnum;                //2

        public string 
               Q,                   //The capital of England A)? B)London C)? D)?
               A;                   //B
    }

I feel ridiculous as if I should know how to do this but I am just not capable of doing it, any help is much appreciated.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Ryan
  • 1
  • 3

1 Answers1

1

You have to read the file and store the string in your code, then remove the line from the string and write it back on the file.

Take a look at this question's answer if you need more details

Delete specific line from a text file?

Community
  • 1
  • 1
AlexC
  • 402
  • 1
  • 4
  • 11
  • Thanks AlexC this has definitely helped me get closer to figuring this out. Much appreciated – Ryan Jun 15 '14 at 16:59