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);
- ShowMenu();
- Console.WriteLine("Doei");
- Console.ReadLine();
- }
- else
- {
- Console.Write("Max aantal pogingen begrijkt neem contact op met uw netwerk administrator");
- Console.ReadLine();
- }
- }
- private static statusPass auth(string passWordUser)
- {
- {
- string passWord = "1";
- statusPass InlogStatus;
- InlogStatus = statusPass.Onbekend;
- if (passWordUser == passWord)
- {
- InlogStatus = statusPass.OK;
- }
- else
- {
- InlogStatus = statusPass.NietOK;
- }
- return (InlogStatus);
- }
- }
- private static void ShowMenu()
- {
- ConsoleKeyInfo pressed;
- Console.WriteLine("My Options");
- Console.WriteLine();
- Console.WriteLine("1. Overzicht mp3 spelers");
- Console.WriteLine("2 - menu option 2");
- Console.WriteLine("3 - menu option 3");
- Console.WriteLine("4 - menu option 4");
- Console.WriteLine("5 - menu option 5");
- Console.WriteLine("6 - menu option 6");
- Console.WriteLine("7 - menu option 7");
- Console.WriteLine("8 - menu option 8");
- Console.WriteLine("9 - menu option 9");
- Console.Write("Choice (1,2,3,4,5,6,7,8,or 9): ");
- Console.WriteLine(" ");
- pressed = Console.ReadKey();
- showSelectedMenu(pressed.Key.ToString());
- }
- private static void showSelectedMenu(string MyChoice)
- {
- //ConsoleKeyInfo pressed;
- switch (MyChoice)
- {
- case "D1":
- Console.WriteLine(" gekozen actie: 1. Overzicht mp3 spelers");
- Console.ReadLine();
- break;
- case "D2":
- Console.WriteLine(" test applicatie");
- Console.ReadLine();
- break;
- case "D3":
- Console.WriteLine(" test applicatie");
- Console.ReadLine();
- break;
- case "D4":
- Console.WriteLine(" test applicatie");
- Console.ReadLine();
- break;
- case "D5":
- Console.WriteLine(" test applicatie");
- Console.ReadLine();
- break;
- case "D6":
- Console.WriteLine(" test applicatie");
- Console.ReadLine();
- break;
- case "D7":
- Console.WriteLine(" test applicatie");
- Console.ReadLine();
- break;
- case "D8":
- Console.WriteLine(" test applicatie");
- Console.ReadLine();
- break;
- case "D9":
- Console.WriteLine(" \nPress enter to end program");
- Console.ReadLine();
- break;
- default:
- Console.WriteLine(" unknown MenuItem");
- Console.ReadLine();
- break;
- }
- return ;
- }
- struct mp3Type1
- {
- public char test;
- public char test;
- public char test;
- public char test;
- public char test;
- public char test;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement