How to create a password program

3 visualizzazioni (ultimi 30 giorni)
Mike
Mike il 12 Set 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.. ^_^'

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su App Building in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by