Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.14 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             // HÄR VÄLJER DU LÖSENORD OCH ANVÄNDAR NAMN SOM DU SENARE ANVÄNDER FÖR ATT LOGGA IN
  13.  
  14.             Console.Write("Välkommen till Eriks lilla program. (Tryck 'Enter' för att fortsätta)");
  15.             Console.ReadKey();
  16.             Console.Clear();
  17.  
  18.             Console.Write("Mata in ett användarnamn: ");
  19.             string UserName;
  20.             UserName = Console.ReadLine();
  21.  
  22.             Console.Clear();
  23.  
  24.             Console.Write("Mata in ett lösenord: ");
  25.             string PassWord;
  26.             PassWord = Console.ReadLine();
  27.  
  28.             Console.Clear();
  29.  
  30.             //HÄR ÄR HUVUDMENYN
  31.  
  32.             string Val1 = "1";
  33.             Console.Write("VAD VILL DU GÖRA?");
  34.             Console.WriteLine("");
  35.             Console.WriteLine("1. LOGGA IN    2. STÄNG AV");
  36.  
  37.             string MenyVal;
  38.             MenyVal = Console.ReadLine();
  39.  
  40.             if (MenyVal == Val1)
  41.             {
  42.                 Console.Clear();
  43.                 Console.Write("USERNAME: ");
  44.                 string UserName2 = Console.ReadLine();
  45.  
  46.                 if (UserName == UserName2)
  47.                 {
  48.                     Console.Clear();
  49.                     Console.Write("PASSWORD: ");
  50.                     string PassWord2 = Console.ReadLine();
  51.  
  52.                     if (PassWord == PassWord2)
  53.                     {
  54.                         Console.Clear();
  55.                         Console.Write("ACCESS GRANTED!");
  56.                         Console.ReadKey();
  57.  
  58.                     }
  59.  
  60.                 }
  61.                 else
  62.                 {
  63.                     Console.Clear();
  64.                     Console.Write("PASSWORD: ");
  65.                     string FAIL = Console.ReadLine();
  66.  
  67.                     Console.Clear();
  68.                     Console.Write("ACCESS DENIED!");
  69.                     Console.ReadKey();
  70.                 }
  71.  
  72.             }
  73.             else
  74.             {
  75.  
  76.             }
  77.  
  78.  
  79.  
  80.  
  81.  
  82.         }
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement