Advertisement
Guest User

password protector

a guest
Sep 19th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace passwordprogram
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. string usernameInput;
  11. string passwordInput;
  12. string username = "User";
  13. string password = "Pass";
  14.  
  15. Console.WriteLine("Please enter your username and password below!");
  16.  
  17. Console.Write("Username: ");
  18. usernameInput = Console.ReadLine();
  19.  
  20. Console.Write("Password: ");
  21. passwordInput = Console.ReadLine();
  22.  
  23. if (username == usernameInput && password == passwordInput)
  24. {
  25. Console.WriteLine("Welcome back {0}!", username);
  26. System.Diagnostics.Process.Start(@"C:\Windows\System32\Notepad.exe");
  27. }
  28.  
  29. else if (username == usernameInput | password == passwordInput)
  30. Console.WriteLine("Incorrect username/password combo.");
  31. else
  32. Console.WriteLine("Incorrect! Try again");
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement