Guest User

Untitled

a guest
Aug 9th, 2016
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Commandline
  8. {
  9. class User
  10. {
  11. List<User> users = new List<User>
  12. {
  13. new User()
  14. {
  15. Username = "Username",
  16. Password = "Password"
  17. }
  18. };
  19.  
  20. public string Username { get; set; }
  21. public string Password { get; set; }
  22.  
  23. public bool Login(string username, string password)
  24. {
  25. var user = users.Find(u => u.Username == username);
  26.  
  27. // If we find a user.
  28. if (user != null)
  29. {
  30. if (user.Password == password)
  31. {
  32. return true;
  33. }
  34. }
  35.  
  36. return false;
  37. }
  38. }
  39. }
Add Comment
Please, Sign In to add comment