5
Answers

Password in C# Console Application

Ask a question
Keith

Keith

17y
2.7k
1
I'm prompting the user to key in his id and password in console application.
How do I hide or change the password to 'xxxxx' when the user keys in ?

Console.WriteLine("Pls key in your Login ID");
loginid = Console.ReadLine();
Console.WriteLine("Pls key in your Password");
password = Console.ReadLine();

if (loginname == "123456" && password == "abcdef")

Answers (5)