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 ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- /*
- string[] weekdays = new string[7];
- // string[] week = new string[] { "Sunday", "Monday", "Tuesday" };
- weekdays[0] = "monday";
- weekdays[1] = "tuesday";
- weekdays[2] = "wednesday";
- weekdays[3] = "thursday";
- weekdays[4] = "friday";
- weekdays[5] = "saturday";
- weekdays[6] = "sunday";
- for (int i = 0; i < weekdays.Length; i++)
- {
- Console.WriteLine(weekdays[i]);
- }
- */
- // default data
- string systemUsername = "john";
- string[] systemUsernames = new string[] { "user1", "user2" };
- string systemPassword = "doe";
- string[] systemPasswords = new string[] { "asdasd", "qweqwe" };
- string username = "";
- string password = "";
- bool validCredentials = false;
- // Welcome screen
- Console.WriteLine("Welcome to our system");
- while (validCredentials == false)
- {
- Console.WriteLine("Enter username:");
- username = Console.ReadLine();
- Console.WriteLine("Enter password:");
- password = Console.ReadLine();
- for (int i = 0; i < systemUsernames.Length; i++)
- {
- if (username == systemUsernames[i])
- {
- if (password == systemPasswords[i])
- {
- validCredentials = true;
- Console.WriteLine("Welcome to the system!");
- }
- else
- {
- Console.WriteLine("Incorrect password!");
- }
- }
- }
- }
- // system pause // press key to exit
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement