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();
- DataMp3Player = showAllMp3();
- for (int i = 0; i <= DataMp3Player.GetUpperBound(0); i++)
- {
- string s1 = DataMp3Player[i, 0]; // GET technologies .inc --> volgende iteratie --> Far & Loud, etc...
- string s2 = DataMp3Player[i, 1]; // HF 410 --> volgende iteratie --> XM 600, etc...
- Console.WriteLine("{0}, {1}", s1, s2);
- }
- 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 ;
- }
- private static void showAllMp3()
- {
- DataMp3Player[1].ID = 1;
- DataMp3Player[1].Make = "GET technologies .inc";
- DataMp3Player[1].Model = "HF 410";
- DataMp3Player[1].MBSize = "4096 MB";
- DataMp3Player[1].Price = "129.95";
- DataMp3Player[2].ID = 1;
- DataMp3Player[2].Make = "Far & Loud";
- DataMp3Player[2].Model = "XM 600";
- DataMp3Player[2].MBSize = "8192 MB";
- DataMp3Player[2].Price = "224.95";
- DataMp3Player[3].ID = 1;
- DataMp3Player[3].Make = "Innotivative";
- DataMp3Player[3].Model = "Z3";
- DataMp3Player[3].MBSize = "512 MB";
- DataMp3Player[3].Price = "79.95";
- DataMp3Player[4].ID = 1;
- DataMp3Player[4].Make = "Resistance S.A.";
- DataMp3Player[4].Model = "3001";
- DataMp3Player[4].MBSize = "4096 MB";
- DataMp3Player[4].Price = "124.95";
- DataMp3Player[5].ID = 1;
- DataMp3Player[5].Make = "CBA";
- DataMp3Player[5].Model = "NXT volume";
- DataMp3Player[5].MBSize = "2048 MB";
- DataMp3Player[5].Price = "159.05";
- return DataMp3Player;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement