How do i create a username and password login system that takes multiple accounts
5 ビュー (過去 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
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.
回答 (1 件)
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"]}
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!