How to create a password program

4 次查看(过去 30 天)
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.. ^_^'

采纳的回答

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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 App Building 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by