static void Main(string[] args) { string NameToValidate, PasswordToValidate; UserManager.UserManager UsrMgr = new UserManager.UserManager(); Console.WriteLine("Registering new user ... "); User usr = UsrMgr.RegisterNewUser(args[0], args[1]); Console.WriteLine("New User {0} registered with salt of {1} and salted password of {2} .", usr.Name, usr.Salt, usr.HashedPassword); Console.WriteLine(" ------------Validating user now-----------"); Console.WriteLine("Enter UserName"); NameToValidate = Console.ReadLine(); Console.WriteLine("Enter Password"); PasswordToValidate = Console.ReadLine(); if (UsrMgr.ValidatePassword(NameToValidate, PasswordToValidate)) { Console.WriteLine("Valid user -- Logging in"); } else { Console.WriteLine("Invalid User"); } Console.ReadKey(); }
public MainForm() { InitializeComponent(); LifeApplication = new LifeApplication(); UserManager = new UserManager.UserManager(); LifeApplication.CreateLayout("Layout 1", 200); Layout1 l1 = new Layout1(LifeApplication.Layouts[0]); }
public MainForm() { InitializeComponent(); // Standaard waarden zetten LifeApplication = new LifeApplication(); UserManager = new UserManager.UserManager(); // Layouts maken LifeApplication.CreateLayout("Layout 1", 200); // Vooraf geprogrammeerde Layout inladen Layout1 l1 = new Layout1(LifeApplication.Layouts[0]); // Species maken LifeApplication.CreateSpecies("Dog", 800, 4, Digestion.OmnivorePlant, 10, 100, 100, 1000, 0, 950, 200); LifeApplication.CreateSpecies("Kat", 800, 4, Digestion.Carnivore, 10, 100, 100, 1000, 0, 950, 200); LifeApplication.CreateSpecies("Giraffe", 800, 4, Digestion.Herbivore, 10, 100, 100, 1000, 0, 950, 200); LifeApplication.CreateSpecies("Niksnut", 800, 4, Digestion.Nonivore, 10, 100, 100, 1000, 0, 950, 200); LifeApplication.CreateSpecies("Mens", 800, 4, Digestion.OmnivoreCreature, 10, 100, 100, 1000, 0, 950, 200); }