Advertisement
Guest User

Untitled

a guest
Sep 1st, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.18 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string Username;
  14.             string Password;
  15.             string Answer1;
  16.             string Newname;
  17.             string Newpassword;
  18.        
  19.             Console.WriteLine("Hello and welcome to hazims program please sign in to continue");
  20.             Console.WriteLine("Username:");
  21.             Username = Console.ReadLine();
  22.  
  23.             if (Username.Equals("Hazim"))
  24.             {
  25.                 Console.WriteLine("Password:");
  26.                 Password = Console.ReadLine();
  27.  
  28.                 if (Password.Equals("Hej123"))
  29.                 {
  30.                     Console.WriteLine("Welcome Master");
  31.                 }
  32.                 else
  33.                 {
  34.                     Console.WriteLine("Wrong password");
  35.                 }
  36.  
  37.             }
  38.             else
  39.             {
  40.                 Console.WriteLine("Your account does not exist");
  41.                 Console.WriteLine("Do you want to create a new one?");
  42.                 Console.WriteLine("Yes Or No");
  43.                 Answer1 = Console.ReadLine();
  44.  
  45.                 if (Answer1.Equals("Yes"))
  46.                 {
  47.                     Console.WriteLine("Please enter your new username");
  48.                     Newname = Console.ReadLine();
  49.  
  50.                     Console.WriteLine("Enter your new password");
  51.                     Newpassword = Console.ReadLine();
  52.  
  53.                     Console.WriteLine("Welcome" + Newname);
  54.  
  55.                     Console.WriteLine("Please log in with your password " + Newname);
  56.                     Console.ReadLine();
  57.  
  58.                     if (Console.ReadLine().Equals(Newpassword))
  59.                         {
  60.                         Console.WriteLine("Welcome to the program " + Newname);
  61.                         }
  62.                     else
  63.                     {
  64.                         Console.WriteLine("Wrong password please try again");
  65.                         Console.ReadLine();
  66.  
  67.                         if (Console.ReadLine().Equals(Newpassword))
  68.                         {
  69.                             Console.WriteLine("Welcome to the program " + Newname);
  70.                         }
  71.                         else
  72.                         {
  73.                             Console.WriteLine("Wrong password you have 1 more try");
  74.                             Console.ReadLine();
  75.  
  76.                             if (Console.ReadLine().Equals(Newpassword))
  77.                                 {
  78.                                 Console.WriteLine("Welcome to the program " + Newname);
  79.                             }
  80.                             else
  81.                             {
  82.                                 Console.WriteLine("You have been logged out to protect your account");
  83.                             }
  84.                         }
  85.                     }
  86.                 }
  87.                 else            
  88.                     Console.WriteLine("Thank you for using Hazims program");
  89.                 }
  90.  
  91.                
  92.             }
  93.         }
  94.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement