Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Talskjdf;lkajsfd;lksadf
- namespace ConsoleApplication4
- {
- class Program
- {
- enum statusPass { OK, NietOK, Onbekend, pogingen};
- static void Main(string[] args)
- {
- string userName;
- string passWordUser;
- statusPass InlogStatus;
- InlogStatus = statusPass.Onbekend;
- 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);
- login(InlogStatus);
- Console.ReadLine();
- }
- private static statusPass auth(string passWordUser)
- {
- int aantalPogingen = (0);
- do
- {
- string passWord = "SHARPSOUND";
- statusPass InlogStatus;
- InlogStatus = statusPass.Onbekend;
- if (passWordUser == passWord)
- {
- InlogStatus = statusPass.OK;
- }
- else
- {
- InlogStatus = statusPass.NietOK;
- InlogStatus = statusPass.pogingen;
- }
- return (InlogStatus);
- aantalPogingen = (++); // hier zit nog iets niet goed C# geef hier aan dat er en Invalid expression term ')',en de "aantalPogingen" is unrechble code.
- }
- while (aantalPogingen < 3);
- }
- 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.pogingen:
- Console.WriteLine("U heeft nog ..(moer ik nog wat op verzinnen)... over");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment