The below Code can be used to display "*" instead of the users typed characters.
Just like the Password Text Box in Winforms.
In the Main Method Type the Following Code
ConsoleKeyInfo key;string pass = "";
do{
key = Console.ReadKey(true);
if (key.Key != ConsoleKey.Backspace) // Backspace Should Not Work
{
pass += key.KeyChar;
Console.Write("*");
}
} while (key.Key != ConsoleKey.Enter); // Stops Receving Keys Once Enter is Pressed
Console.WriteLine();
Console.WriteLine("The Password You entered is : " + pass);
Regards
Hefin Dsouza