public UserEnter(object userbase) { InitializeComponent(); LoginTextbox.Text = Resources.Логин_; PasswordTextbox.Text = Resources.Пароль_; userBase = (UserBase) userbase; }
public RegistrationForm(object users) { InitializeComponent(); LoginTextbox.Text = Resources.RegistrationForm_RegistrationForm_Введите_логин_; PasswordTextbox.Text = Resources.RegistrationForm_RegistrationForm_Введите_пароль_; Password2Textbox.Text = Resources.RegistrationForm_RegistrationForm_Повторите_пароль_; userBase = (UserBase) users; }
static void Main() { UserBase userBase = new UserBase(); object userso = userBase; int problemCounter; List<Problem> problems = new List<Problem>(); int UserCounter; List<User> users = new List<User>(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new Form1()); Application.Run(new Logon(userso)); }
public bool Enter(UserBase userBase, string login, string password) { if (userBase.FileCheck()) { userBase.Deserialize(); } for (int i = 0; i < 100; i++) { if (userBase.Users[i]==null) break; if (userBase.Users[i].Login == login && userBase.Users[i].Password == password) return true; } throw new Exception("Не удалось выполнить вход"); }
public void CreateUser(UserBase userBase, string login, string password) { if (userBase.FileCheck()) { userBase.Deserialize(); } for (int i=0; i < 1000; i++) { if (userBase.Users[i] == null) { userBase.Users[i] = new User(login, password); break; } } userBase.Serialize(); }