Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- // data variables
- string username = "john";
- string password = "doe";
- // keyboard input
- string user = "";
- string pass = "";
- do {
- Console.WriteLine("Please enter username:");
- user = Console.ReadLine();
- Console.WriteLine("Please enter password:");
- pass = Console.ReadLine();
- if (user == username) {
- if (pass == password)
- {
- Console.WriteLine("Welcome to our system!");
- }
- else
- {
- Console.WriteLine("Invalid password");
- }
- }
- else
- {
- Console.WriteLine("No such user found!");
- }
- } while (username != user || password != pass);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement