Need Help with this code

Now, this may sound stupid, as it concerns basic file I/O, but my code doesn't work correctly- at least it isn't doing what I want it to. I wanted it to write a file the first time it runs, which it does perfectly, and every time it is run after that, it should read the written file and store values off it(like username and password) and correlate it to validate user input. However, I am facing some problems, which is very likely to be an elementary one, about how I am not getting the required values after reading the file.for example: the file is as following
1 admin adminpass
where the three columns are id, admin username and admin password. It writes it perfectly, reads it as well, as I get no compilation error and no runtime error as well.

I made some changes to the code, but now the problem seems to be opening the file. Again, I am mystified, probably as its quite late, but still, could anyone point out where the Code fails? I have tried debugging it and it points to this line - "ifstream read(adminfile);". I can't make sense of this problem.