Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Commandline
- {
- class User
- {
- List<User> users = new List<User>
- {
- new User()
- {
- Username = "Username",
- Password = "Password"
- }
- };
- public string Username { get; set; }
- public string Password { get; set; }
- public bool Login(string username, string password)
- {
- var user = users.Find(u => u.Username == username);
- // If we find a user.
- if (user != null)
- {
- if (user.Password == password)
- {
- return true;
- }
- }
- return false;
- }
- }
- }
Add Comment
Please, Sign In to add comment