static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); frmStart f = new frmStart(); Application.Run(new MyContext()); }
private void btnLogin_Click(object sender, EventArgs e) { if (validForm()) { user = new User(); if (user.login(txtUser.Text.ToString().ToLower(), txtPass.Text.ToString(), getIP())) { if (chkRemember.Checked) { Settings.Default.username = txtUser.Text.ToString().ToLower(); Settings.Default.password = txtPass.Text.ToString(); Settings.Default.Save(); } else { Settings.Default.username = ""; Settings.Default.password = ""; Settings.Default.Save(); } frmStart form = new frmStart(user); this.Visible = false; form.Show(); this.Close(); } else lblError.Text = "There was an error while logging in"; } }
private void btnCancel_Click(object sender, EventArgs e) { frmStart f = new frmStart(thisUser); f.Show(); this.Close(); }