Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DemoProgram1HelloWorld {
- class Program {
- static void Main(string[] args) {
- string username;
- string password;
- bool loggedin = false;
- while(!loggedin) {
- Console.Write("Enter username: ");//asks for username and stores it to variable "username"
- username=Console.ReadLine();
- Console.Write("Enter password: ");//requests password
- password=Console.ReadLine();
- if(username=="Bioniclegenius"&&password=="blaarg") {
- Console.WriteLine("Login was successful!");
- loggedin=true;
- }
- else if(username!="Bioniclegenius") {
- Console.WriteLine("Invalid username.");
- }
- else {
- Console.WriteLine("Invalid password.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement