matlab - password program

3 ビュー (過去 30 日間)
Arthur II
Arthur II 2017 年 12 月 9 日
編集済み: Arthur II 2017 年 12 月 10 日
It's my password program with locked property. It's okay, but first of all why Cancel button doesn't work? also there's a simple problem with this locked property: if you enter your password incorrectly three times, first of all 'Try again' will show and then 'LOCKED!'. you know this feature isn't interesting. I want to show ONLY one message that's LOCKED!
if (strcmp(pass,password))
uiwait(msgbox('Welcome!'));
break;
else
uiwait(errordlg('Try again!'));
wrong = wrong + 1;
if (wrong == 3)
lock = true;
break;
end
end
end
if (lock)
uiwait(errordlg('LOCKED!'));
return;
end

採用された回答

Walter Roberson
Walter Roberson 2017 年 12 月 9 日
else
wrong = wrong + 1;
if (wrong == 3)
lock = true;
break;
else
uiwait(errordlg('Try again!'));
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by