How to create a password program

3 Ansichten (letzte 30 Tage)
Mike
Mike am 12 Sep. 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.. ^_^'

Akzeptierte Antwort

Matt Fig
Matt Fig am 12 Sep. 2012
GUI_37 gives a demo of this.
  2 Kommentare
Mike
Mike am 12 Sep. 2012
OK sir.. ill work on it..
thanks! ^_^
Mike
Mike am 12 Sep. 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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu App Building finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by