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;
- namespace ConsoleApplication4
- {
- class Program
- {
- enum statusPass { OK, NietOK, Onbekend};
- static void Main(string[] args)
- {
- string userName;
- string passWordUser;
- statusPass InlogStatus;
- InlogStatus = statusPass.Onbekend;
- int poging = (0);
- int maxPoging = (3);
- Console.Write("Console Asks - Please Enter your Name: ");
- userName = Console.ReadLine();
- Console.WriteLine("");
- while (InlogStatus != statusPass.OK)
- {
- Console.WriteLine("U heeft nog ({0}/{1}) over", poging, maxPoging);
- Console.WriteLine("************************************");
- Console.Write("Console Asks - Please Enter your Password: ");
- passWordUser = Console.ReadLine();
- InlogStatus = auth (passWordUser);
- switch (InlogStatus)
- {
- case statusPass.OK:
- Console.WriteLine("************************************");
- Console.WriteLine("Wacht Woord is Okey");
- break;
- case statusPass.NietOK:
- Console.WriteLine("************************************");
- Console.WriteLine("Wacht Woord is niet goed");
- poging++;
- if (poging == 2)
- {
- Console.WriteLine("LET OP: Laatste poging!");
- }
- break;
- }
- if (poging == 3)
- break;
- }
- if (InlogStatus == statusPass.OK)
- {
- Console.WriteLine("************************************");
- Console.Write("Welkom bij Sharpsound ({0})", userName);
- Console.ReadLine();
- }
- else
- {
- Console.Write("Max aantal poginen begrijkt neem contact op met uw netwerk administrator");
- Console.ReadLine();
- }
- }
- private static statusPass auth(string passWordUser)
- {
- {
- string passWord = "SHARPSOUND";
- statusPass InlogStatus;
- InlogStatus = statusPass.Onbekend;
- if (passWordUser == passWord)
- {
- InlogStatus = statusPass.OK;
- }
- else
- {
- InlogStatus = statusPass.NietOK;
- }
- return (InlogStatus);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement