writer - Reading from binary file into several labels on a form in C# -
i'm writing trivia game app in c# writes data binary file, reads data file 6 labels. 6 labels follows:
lblquestion // question text goes.
lblpoints // question points goes.
lblanswera // multiple choice answer goes.
lblanswerb // multiple choice answer b goes.
lblanswerc // multiple choice answer c goes.
lblanswerd // multiple choice answer d goes.
here code writing binary file:
{ bw.write(question); bw.write(points); bw.write(answera); bw.write(answerb); bw.write(answerc); bw.write(answerd); }
now code read data file corresponding labels:
{ filestream fs = file.openread(ofd.filename); binaryreader br = new binaryreader(fs); lblquestion.text = br.readstring(); lblpoints.text = br.readint32() + " points"; lblanswera.text = br.readstring(); lblanswerb.text = br.readstring(); lblanswerc.text = br.readstring(); lblanswerd.text = br.readstring(); }
the question string reads correctly lblquestion.
the points value reads correctly lblpoints.
answera, answerb, , answerc not read lblanswera, lblanswerb , lblanswerc respectively.
lblanswerd, however, gets string meant lblanswera.
looking @ code reading data labels, there missing, sort of incremental value needs inserted code in order strings correct labels?
Comments
Post a Comment