daily pastebin goal
30%
SHARE
TWEET

Untitled

a guest Jun 18th, 2017 510 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace Console_App
  5. {
  6.     class Program
  7.     {
  8.         static void Main()
  9.         {
  10.             var users = new List<User>
  11.             {
  12.                 new User
  13.                 {
  14.                     Username = "rileyhempel",
  15.                     Password = "test",
  16.                     Email = "rileyhempel@outlook.com",
  17.                     Age = "16",
  18.                     Height = "5 foot 11 inches",
  19.                     Weight = "65kg",
  20.                     HairColour = "Blonde",
  21.                     EyeColour = "Brown",
  22.                     Pet = new Pet()
  23.                     {
  24.                         Name = "Doggo",
  25.                         Type = "Cat"
  26.                     }
  27.                 },
  28.                 new User
  29.                 {
  30.                     Username = "stephgolland",
  31.                     Password = "test2",
  32.                     Email = "stephgolland@hotmail.com",
  33.                     Age = "16",
  34.                     Height = "5 foot 5 inches",
  35.                     Weight = "55kg",
  36.                     HairColour = "Blonde",
  37.                     EyeColour = "Hazel",
  38.                     Pet = new Pet()
  39.                     {
  40.                         Name = "Snip Snap Doggo",
  41.                         Type = "Scorpion"
  42.                     }
  43.                 },
  44.                 new User
  45.                 {
  46.                     Username = "jordanberlyn",
  47.                     Password = "test3",
  48.                     Email = "jordanberlyn@gmail.com",
  49.                     Age = "26",
  50.                     Height = "5 foot 10 inches",
  51.                     Weight = "70kg",
  52.                     HairColour = "Brown",
  53.                     EyeColour = "Blue",
  54.                     Pet = new Pet()
  55.                     {
  56.                         Name = "Grizlord",
  57.                         Type = "Bear"
  58.                     }
  59.                 },
  60.             };
  61.  
  62.             Console.WriteLine("Hello there!");
  63.             Console.WriteLine("Please enter your username.");
  64.             var username = Console.ReadLine();
  65.             var user = users.Find(i => i.Username == username);
  66.             if (user == null)
  67.             {
  68.                 Console.WriteLine("Incorrect username. Please try again.");
  69.                 Main();
  70.             }
  71.  
  72.             Console.WriteLine("Please enter your password.");
  73.             var password = Console.ReadLine();
  74.             if (password != user.Password)
  75.             {
  76.                 Console.WriteLine("Incorrect password. Please try again.");
  77.                 Main();
  78.             }
  79.  
  80.             Console.WriteLine("You have successfully logged into your account.");
  81.             Console.WriteLine($"Your pets name is {user.Pet.Name} and it is a {user.Pet.Type}");
  82.             Console.WriteLine("Please enter your email for more information about your account.");
  83.             var email = Console.ReadLine();
  84.  
  85.             if (email != user.Email)
  86.             {
  87.                 Console.WriteLine("Incorrect email. Logging out of account.");
  88.                 Main();
  89.             }
  90.  
  91.             Console.WriteLine("You have successfully bypassed all of your accounts security.");
  92.             Console.WriteLine("Well done!");
  93.             Console.WriteLine("Here is some more information about your account.");
  94.             Console.WriteLine($"You are {user.Age} years of age.");
  95.             Console.WriteLine($"You are {user.Height} tall and weigh {user.Weight}.");
  96.             Console.WriteLine($"Your hair colour is {user.HairColour} and your eyes are {user.EyeColour}");
  97.             Console.WriteLine("Press any key then hit 'enter' to log out, or hit 'x' to exit the program.");
  98.             Console.ReadLine();
  99.             Main();
  100.         }
  101.  
  102.         public class User
  103.         {
  104.             public string Username;
  105.             public string Password;
  106.             public string Email;
  107.             public string Age;
  108.             public string Height;
  109.             public string Weight;
  110.             public string HairColour;
  111.             public string EyeColour;
  112.             public Pet Pet;
  113.         }
  114.         public class Pet
  115.         {
  116.             public string Name;
  117.             public string Type;
  118.         }
  119.     }
  120. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top