필터 지우기
필터 지우기

How do i create a username and password login system that takes multiple accounts

조회 수: 12 (최근 30일)
i need to create an app that is a log-in system for multiple people. As of now i can only do one password/username combination. how do i add more
  댓글 수: 2
Les Beckham
Les Beckham 2022년 2월 22일
You are more likely to get a good answer for how to update your code if you show the code that you have now.
Andrew Cuaki
Andrew Cuaki 2022년 2월 22일
password = app.PasswordEditField.Value;
passworddef = 'password';
b=length(password); b1=length(passworddef);
username = app.UsernameEditField.Value;
usernamedef = 'EmployeeA';
a=length(username); a1=length(usernamedef);
if(a==a1 && b==b1)
This is all i have so far i tried using the ";" and "or(...)" and "|" but they dont seem to work

댓글을 달려면 로그인하십시오.

답변 (1개)

Benjamin Thompson
Benjamin Thompson 2022년 2월 22일
Use strcmp to compare string contents rather than their lengths. Not that MATLAB is probably not very secure for taking passwords from users and making sure memory is cleared to zero when memory is no longer needed. Or at least, use the hash function and only store passwords as hashed strings.
You can store multiple strings like user names or passwords using cell arrays, like:
>> usernames{1} = "Harry"
usernames =
1×1 cell array
{["Harry"]}
>> usernames{2} = "Sally"
usernames =
1×2 cell array
{["Harry"]} {["Sally"]}

카테고리

Help CenterFile Exchange에서 Install Products에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by