Writing and Reading binary files not working
Im making a game in windows forms for school and im making a register and login screen where i make use of binary files, whenever I try to login though i just get an error that its wrong everytime. I accidentally opened the .bin file in notepad earlier which may have f'd it up im not sure
15 Replies
notepad not going to modify it unless you added text and saved it. Show your code, show the error.
thats the code for writing to the file
hmm. ok.
I would love to see the reading.
Have yo utried writing inplain text first to get that working
I don't see how you will be able to parse that when reading it, as-is
thats then the reading in a different class
Right.
So you have debugged this, and looked at the values, correct?
Ahh no
$debug
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
im sorry i just realised the errror there now omg
i spent like the past 2 hours looking thrugh this it was
if (userArray[x, 2] == username)
if (userArray[x, 3] == password)
this part but i had my username as the third and the password should be the fourth
different order?
yeah
its always something so simple lo;
off by one errors can take hours to debug 😄
yeah ill always have like tiny spelling errors that will mess everything up lol