Advertisement
Guest User

Untitled

a guest
Jun 30th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication4
  7. {
  8.     class Program
  9.     {
  10.        enum statusPass {OK, NietOK, Onbekend};
  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.             string passWord = "SHARPSOUND";
  38.             statusPass InlogStatus;
  39.             InlogStatus = statusPass.Onbekend;
  40.  
  41.             if (passWordUser == passWord)
  42.             {
  43.                 InlogStatus = statusPass.OK;
  44.                
  45.             }
  46.             else
  47.             {
  48.                 InlogStatus = statusPass.NietOK;
  49.             }
  50.             return (InlogStatus);
  51.         }
  52.  
  53.  
  54.         private static void login(statusPass InlogStatus)
  55.         {
  56.             switch (InlogStatus)
  57.             {
  58.                 case statusPass.OK:
  59.                     Console.WriteLine("Wacht Woord is Okey");
  60.                     break;
  61.                 case statusPass.NietOK:
  62.                     Console.WriteLine("Wacht Woord is niet goed");
  63.                     break;
  64.             }
  65.  
  66.         }
  67.      }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement