TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pisi Can
NA
27
5.2k
C# Console Password Entering Limitation
Nov 8 2015 2:12 PM
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();
Reply
Answers (
2
)
creating PDF File from String
How do I add exception handling in my code?