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};
- enum statusMenu { Menu1, Menu2, Menu3, Menu4, Menu5, Menu6, Menu7, Menu8, Menu9, MyChoise };
- 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();
- }
- 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 press;
- statusMenu MenuChoise; //wordt niet gebruikt geen hij een error hij gaat gewoon door no problem..
- string MyChoise; //wordt niet gebruikt geen hij een error.
- Console.WriteLine("My Options");
- Console.WriteLine();
- Console.WriteLine("1 - menu option 1");
- 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): ");
- do
- {
- press = Console.ReadKey();
- Console.WriteLine(press.Key.ToString());
- } while (press.Key != ConsoleKey.Escape);
- }
- private static void statusMenu (string MyChoise)
- {
- statusMenu MychoiseAnswer;
- MychoiseAnswer = statusMenu.MyChoise; // hier loopt hij vast want hij zegt datie de string niet kan vinden die ik hier defineer omdat ik die string natuurlijk niet heb verwezen uit de andere functie
- switch (MychoiseAnswer)
- {
- case statusMenu.Menu1:
- Console.WriteLine("test applicatie");
- break;
- }
- return;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement