Advertisement
Guest User

Untitled

a guest
Jan 14th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. using System;
  2.  
  3. namespace registrationAndLogin
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string username = ""; // niet slecht om uw variable al te assignen aan iets leeg
  10.             string password = ""; // niet slecht om uw variable al te assignen aan iets leeg
  11.             int loginCount = 0; // zoals je hier wel deed = 0
  12.  
  13.             Console.WriteLine("Welcome to the login system");
  14.             Console.WriteLine("Please commence by entering your username");
  15.             username = Console.ReadLine(); // hier je input aan je username toekennen
  16.  
  17.                 if (username == "abcd")
  18.                 {
  19.                     Console.WriteLine("Now enter your password");
  20.                 loginCount = 0;
  21.                     Console.ReadLine();
  22.                 }
  23.                 else
  24.                 {
  25.                     loginCount ++;
  26.                     Console.Write("Wrong username, ",3-loginCount," attemps remaining");
  27.                     Console.ReadKey();
  28.                 }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement