Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace BaseClassLibrary
- {
- class Program
- {
- static void Main(string[] args)
- {
- int id = 59943; //Assuming a user id
- string password = "Kiss4Love!"; //Assuming a password
- int attempt = 0;
- int userid;
- string pass;
- do
- {
- Console.WriteLine("Username: ");
- userid = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Password: ");
- pass = Convert.ToString(Console.ReadLine());
- if (userid == id && pass == password)
- {
- Console.WriteLine("Login Successful!!");
- Console.ReadKey();
- return;
- }
- else
- {
- Console.WriteLine("Wrong Credintials! Try again!");
- attempt++;
- }
- } while (attempt < 3);
- Console.WriteLine("You had your maximum attempts!");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement