Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
How does one display the "*" character when any key is pressed, but retrieve the actual key pressed?

EXAMPLE ...
C#
string UserID = "";
string Password = "";
Console.Write("Enter User ID: ");
UserID = Colsole.ReadLine();
Console.Write("Enter Password: ");
//
// I don't want what is typed to be displayed - but display a "*" for each key pressed
//
Password = Console.ReadLine();
Posted
Updated 29-Jun-12 5:56am
v2

This[^] looks like it has an answer to your question.
 
Share this answer
 
There is a lot of good information on the subject in the articles here[^], here[^] and here[^].
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900