Hi guys im writing a program and was wondering what the code would be to prompt for a password when pressing a button

ie. I have a button that checks who earns the most money and only certain people have access to that button through a password.

Recommended Answers

All 2 Replies

I should think the best way is to have everyone log in when they start the program. If you do that then you can easily expand on your idea to associate certain buttons and stuff by user and/or password. If the user does not have permissions to press a certain button then just hide it after logging into the program.

I should think the best way is to have everyone log in when they start the program. If you do that then you can easily expand on your idea to associate certain buttons and stuff by user and/or password. If the user does not have permissions to press a certain button then just hide it after logging into the program.

Yeap if those people who are authorised to access that part their password's as well as usernames are stored somewhere then it will be much easy to block those who are not authorised to access that part, Here is how you can do it. On your button before you put the instruction to open that part in which it can be accessed by authorised person only you have to first verify that person's identity who is clicking that button by providing a login screen where if the entered details are for that person who is authorised then he/she can access it or else the system denies the access.

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.