0
I have a college job where I need to create a kind of ATM in C#, where I have to create two textbox in which I have to enter a four-digit password in the first, and fix the same masked password in the second.
The password must be entered in four different Uttons with three digits in each. The design part is good for me, my difficulty is in coding.
I have to enter the password by the buttons, to appear in the first textbox (visible), in the second (masked). If the password is correct the message should appear "Senha OK
" and close the application.
Wrong attempts can only occur twice, if the third should appear the message "Cartão bloqueado
" and close the application.
What code did you try so far?:
– PauloHDSousa
Well the only thing I did so far was set the password size in the first textbox set the size 4 (because the password must be 4 digits) and set * in maskedTextBox.
– Ana Paula Vieira
It depends on where the user is and the password, but you probably just need to compare if the password and the user match the values you have stored. For the faculty, it is possible for the teacher to accept user and passwords in the code itself.
– Rodrigo Guiotti
Button values will be fixed or variable?
– Jéf Bueno
I would like someone to give me a help on the array code. And give me a hint of how I make the one inserted by the buttons appear so much in the qto textbox in the maskedbox. This form does not have a user defined, it would be as if the user had entered the card and had to enter the password.
– Ana Paula Vieira
The values of the buttons are fixed
– Ana Paula Vieira
Good.. The password must be entered by the 4 buttons. Let’s say the password is 5930, so I must press the first button on the right, the second one on the left, the top data and then the bottom left one... This password must be trimmed in the textbox in ***, but my teacher wants the password typed to appear in the textbox in a visible way also... The only thing I know is 4 ifs first to see if the sequence of the buttons match, and then there are other ifs to see if the sequence of the numbers inside the buttons match the password.
– Ana Paula Vieira
Tb do not know exactly what command I use to terminate the application, which should occur both by putting the correct password, qto passing the maximum number of wrong attempts.
– Ana Paula Vieira
@Anapaulavieira you could show where is the specific point that you are having difficulty? It seems to me that you lack basis, but if you divide these problems into several specific parts maybe to solve it.
– gato
Post your code too, so it’s better for the community to understand.
– gato
your textbox that will receive the password of the user and show the same must be the normal one but the one that will receive the password of the same mask must be the type password that when typing the same already appears masked.. ai just vc "set" the button for both text box follows an example .. that code and in java do not know how it would look in c# .. button.setText("desired local1"); and button.setText("desired local2"); in this case it would show in both textboxes but in the default texbox it would show the password already in the other because it is of the "password" type it would appear masked .. I hope it helped.
– Tiago