Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
61
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. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.WriteLine("Hello Bitches");
  14. string pass = "";
  15. Console.Write("Enter your password: ");
  16. ConsoleKeyInfo key;
  17.  
  18. do
  19. {
  20. key = Console.ReadKey(true);
  21.  
  22. // Backspace Should Not Work
  23. if (key.Key != ConsoleKey.Backspace)
  24. {
  25. pass += key.KeyChar;
  26. Console.Write("*");
  27. }
  28. else
  29. {
  30. Console.Write("\b");
  31. }
  32. }
  33. // Stops Receving Keys Once Enter is Pressed
  34. while (key.Key != ConsoleKey.Enter);
  35.  
  36. Console.WriteLine();
  37. Console.WriteLine("The Password You entered is : " + pass);
  38.  
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement