Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. namespace UDEMY_SECTION_4
  2. {
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. Console.WriteLine("Create a username: ");
  8. string un = Console.ReadLine();
  9. Console.WriteLine("Create a password: ");
  10. string pw = Console.ReadLine();
  11. Console.WriteLine("Enter in username: ");
  12. string inputUN = Console.ReadLine();
  13. Console.WriteLine("Enter in password: ");
  14. string inputPW = Console.ReadLine();
  15.  
  16. while (inputUN != un && inputPW != pw)
  17. {
  18. Console.WriteLine("Incorrect username or password. Try again.");
  19. Console.WriteLine("Enter in username: ");
  20. inputUN = Console.ReadLine();
  21. Console.WriteLine("Enter in password: ");
  22. inputPW = Console.ReadLine();
  23. if (inputUN == un && inputPW == pw)
  24. {
  25. Console.WriteLine("You are logged in!");
  26. }
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement