I've attached the code I have that deals with allowing a user to have access to the main menu. When adding a new user, the username and password is saved to a text file. However, I want to add a default username and password so when a user runs the program for the first time, he/she can have access to the main menu which allows him to add his username/password to the accounts text file. the other option is...if there are no usernames or passwords available(the accounts text file has not been made) an option of adding a new user will show up in the login menu only that one time.

any help will be greatly appreciated...thanks


No one is going to sort through all of that just to give you an explanation that is quite simple anyway. One thing you could do is check to see how many usernames your program currently has, and if it's 0, then display a screen allowing the user to create a username and password. However, a better thing to do (depending on what your project guidelines are) would be to have a menu that allows the user to choose between signing in on an existing account or creating a new account.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.