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, MaxPogingBerijkt };
- static void Main(string[] args)
- {
- string userName;
- string passWordUser;
- statusPass InlogStatus;
- InlogStatus = statusPass.Onbekend;
- int poging = (0);
- int maxPoging = (3);
- do
- {
- Console.WriteLine("U heeft nog ...(maxPoging - poging).. over");
- Console.Write("Console Asks - Please Enter your Name: ");
- userName = Console.ReadLine();
- Console.WriteLine("");
- Console.Write("Console Asks - Please Enter your Password: ");
- passWordUser = Console.ReadLine();
- InlogStatus = auth (passWordUser);
- switch (InlogStatus)
- {
- case statusPass.OK:
- Console.WriteLine("Wacht Woord is Okey");
- //exit while loop
- break;
- case statusPass.NietOK:
- Console.WriteLine("Wacht Woord is niet goed");
- poging++;
- break;
- }
- while(poging < 3);
- } // loopt hier op stuk
- } // loopt hier ook op stuk
- 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);
- }
- }
- private static void login(statusPass InlogStatus)
- {
- switch (InlogStatus)
- {
- case statusPass.OK:
- Console.WriteLine("Wacht Woord is Okey");
- break;
- case statusPass.NietOK:
- Console.WriteLine("Wacht Woord is niet goed");
- break;
- case statusPass.MaxPogingBerijkt:
- Console.WriteLine("Maximum aantal pogingen berijkt neem contact op met uw netwerk administrator");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement