How to create a password program

3 visualizaciones (últimos 30 días)
Mike
Mike el 12 de Sept. de 2012
Hello there guys...
Please help me to create a program that will accept a user and a password. the Algo will be like this. >>>>>Run the program
>>prompt
>>Username: %the user will type the username say for example admin
>>password: %the user will type the password for example still "admin".. BUT. the password should be in "asterisk" for protection purposes!..
i cant figure if what im going to do in this part. help me guys.. ^_^'

Respuesta aceptada

Matt Fig
Matt Fig el 12 de Sept. de 2012
GUI_37 gives a demo of this.
  2 comentarios
Mike
Mike el 12 de Sept. de 2012
OK sir.. ill work on it..
thanks! ^_^
Mike
Mike el 12 de Sept. de 2012
on my current level.. its hard for me to understand some of the syntax you used on the program. but the comment help me a little....
im doing it w/o GUI.. my only problem is to type the password w/o showing the word but "*" only..
heres my code:
clc
userdef='admin';
passdef='admin';
userin=input(' Username: ','s');
passin=input(' Password: ','s');
a=length(userin); a1=length(userdef);
b=length(passin); b1=length(passdef);
if(a==a1 & b==b1)
if(userin==userdef & passin==passdef)
fprintf(' Correct!');
else
fprintf(' Wrong!');
end
else
fprintf(' Wrong!');
end
%actually.. this just a piece of program. im going to apply this on our project

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by