SHOW:
|
|
- or go back to the newest paste.
| 1 | using System; | |
| 2 | using System.Collections.Generic; | |
| 3 | using System.Linq; | |
| 4 | - | using System.Text; |
| 4 | + | using System.Talskjdf;lkajsfd;lksadf |
| 5 | ||
| 6 | namespace ConsoleApplication4 | |
| 7 | {
| |
| 8 | class Program | |
| 9 | {
| |
| 10 | enum statusPass { OK, NietOK, Onbekend, pogingen};
| |
| 11 | ||
| 12 | ||
| 13 | static void Main(string[] args) | |
| 14 | {
| |
| 15 | string userName; | |
| 16 | string passWordUser; | |
| 17 | statusPass InlogStatus; | |
| 18 | InlogStatus = statusPass.Onbekend; | |
| 19 | ||
| 20 | Console.Write("Console Asks - Please Enter your Name: ");
| |
| 21 | ||
| 22 | userName = Console.ReadLine(); | |
| 23 | ||
| 24 | Console.WriteLine("");
| |
| 25 | ||
| 26 | Console.Write("Console Asks - Please Enter your Password: ");
| |
| 27 | passWordUser = Console.ReadLine(); | |
| 28 | ||
| 29 | InlogStatus = auth (passWordUser); | |
| 30 | login(InlogStatus); | |
| 31 | ||
| 32 | Console.ReadLine(); | |
| 33 | } | |
| 34 | ||
| 35 | private static statusPass auth(string passWordUser) | |
| 36 | {
| |
| 37 | int aantalPogingen = (0); | |
| 38 | ||
| 39 | do | |
| 40 | {
| |
| 41 | string passWord = "SHARPSOUND"; | |
| 42 | statusPass InlogStatus; | |
| 43 | InlogStatus = statusPass.Onbekend; | |
| 44 | ||
| 45 | if (passWordUser == passWord) | |
| 46 | {
| |
| 47 | InlogStatus = statusPass.OK; | |
| 48 | ||
| 49 | } | |
| 50 | else | |
| 51 | {
| |
| 52 | InlogStatus = statusPass.NietOK; | |
| 53 | InlogStatus = statusPass.pogingen; | |
| 54 | } | |
| 55 | return (InlogStatus); | |
| 56 | aantalPogingen = (++); // hier zit nog iets niet goed C# geef hier aan dat er en Invalid expression term ')',en de "aantalPogingen" is unrechble code. | |
| 57 | } | |
| 58 | while (aantalPogingen < 3); | |
| 59 | ||
| 60 | } | |
| 61 | ||
| 62 | ||
| 63 | private static void login(statusPass InlogStatus) | |
| 64 | {
| |
| 65 | switch (InlogStatus) | |
| 66 | {
| |
| 67 | case statusPass.OK: | |
| 68 | Console.WriteLine("Wacht Woord is Okey");
| |
| 69 | break; | |
| 70 | case statusPass.NietOK: | |
| 71 | Console.WriteLine("Wacht Woord is niet goed");
| |
| 72 | break; | |
| 73 | case statusPass.pogingen: | |
| 74 | Console.WriteLine("U heeft nog ..(moer ik nog wat op verzinnen)... over");
| |
| 75 | break; | |
| 76 | } | |
| 77 | ||
| 78 | } | |
| 79 | } | |
| 80 | } |