Created
April 13, 2021 15:40
-
-
Save sethdorris/a3ae110504e8024ad6221abb78d3b0b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppClass { | |
private User _mainUser; | |
public bool Login() { | |
Console.Clear(); | |
return User.Login(_mainUser); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class User { | |
public int Id { get; set; } | |
public string Username {get;set;} | |
public string Password {get;set;} | |
public static Login(User us) { | |
//ask user for Id | |
//ask user for pw | |
int userId = 0; | |
Int32.TryParse(Console.ReadLine(), out userId); | |
Console.WriteLine("Enter your pw: "); | |
var pw = Console.ReadLine(); | |
return us.Id = userId && us.Password = pw; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment