void Register() { Console.WriteLine("Register you to SpaceBook"); do { Console.WriteLine("All SpaceBook names must be unique"); Console.WriteLine("Type in a user name"); name = Console.ReadLine(); }while (SpaceBook.IsUnique(name)); Console.WriteLine("Type a password"); password = Console.ReadLine(); Console.WriteLine("Thank for registration with SpaceBook"); }
bool Authenticate() { Console.WriteLine("Welkome " + name + "please type your password"); string suplied = Console.ReadLine(); if (suplied == password) { loggedIn = true; Console.WriteLine("You logged into"); if (mySpaceBook == null) { mySpaceBook = new SpaceBook(name); } return(true); } Console.WriteLine("Incorrect password"); return(false); }
public MyOpenBook(string n) { name = n; users++; myOpenBook = new SpaceBook(name + " - " + users); }