Ive done some work saving data in .txt files and loading it a while back, but dont remember to much. I have a program that connects to a server and logs you in, and I want for the users name and pass to be saved to a .dat file or something, in hexidecimal format or something you cant just read. I also need for it to be able to be loaded, and saved into the file something like this:

Number of saved users
0 or 1(For is pass is saved),Username,Pass
Same for next user
and so on