Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
C# Console Password Entering Limitation
Pisi Can
Nov 8 2015 2:12 PM
503
Reply
Hi all! I am new to C#. First steps. I want to write a simple console application that asks the user to enter the password. I want to limit the attempts. For example after three failed attempts console will write "you've failed".
Best wishes
Below code gives the user infinite rights to try:
string Pass= "";
do
{
Console.Write("Enter Password : ");
Pass= Console.ReadLine();
} while (Pass!= "9999");
Console.WriteLine("Success!...");
Console.ReadKey();
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
creating PDF File from String
How do I add exception handling in my code?