static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //注册事件的处理 while (true) { //生成loginForm LoginForm newLoginForm = new LoginForm(); DialogResult newLoginFormResult = newLoginForm.ShowDialog(); if (newLoginFormResult == DialogResult.OK) { HomeForm newHomeFrom = new HomeForm(); newHomeFrom.userinfo = newLoginForm.userinfo; newLoginForm.Close(); newLoginForm.Dispose(); Application.Run(newHomeFrom); break; } //进入注册界面 if (newLoginFormResult == DialogResult.Abort) { newLoginForm.Close(); newLoginForm.Dispose(); RegistForm newRegistForm = new RegistForm(); DialogResult newRegistFormResult = newRegistForm.ShowDialog(); //注册成功转到登录界面 if (newRegistFormResult == DialogResult.OK) { newRegistForm.Close(); newRegistForm.Dispose(); continue; } //返回登录界面 if (newRegistFormResult == DialogResult.Retry) { continue; } break; } //点击退出 break; } }
static void Main() { #if (DEBUG) debug = true; #endif Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); LoginForm loginForm = new LoginForm(); Application.Run(loginForm); if (loginForm.DialogResult == DialogResult.OK) { charList = loginForm.charList; musicList = loginForm.musicList; eList = loginForm.eviList; CharForm CharSelect = new CharForm(); CharSelect.clientSocket = loginForm.clientSocket; //CharSelect.clientSocket = connection; CharSelect.charList = charList; Application.Run(CharSelect); if (CharSelect.DialogResult == DialogResult.OK) { ClientForm AODXClientForm = new ClientForm(); AODXClientForm.clientSocket = CharSelect.clientSocket; AODXClientForm.eviList = eList; AODXClientForm.songs = musicList; AODXClientForm.strName = CharSelect.strName; try { Application.Run(AODXClientForm); } catch (Exception ex) { if (debug) MessageBox.Show(ex.Message + ".\r\n" + ex.StackTrace.ToString(), "AODXClient", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void LoginButton_Click(object sender, EventArgs e) { // Show the Login Form LoginForm loginform = new LoginForm(); loginform.ShowDialog(this); if (loginform.Completed) { String username = loginform.Username; String password = loginform.Password; byte[] pwbytes = MD5.Create().ComputeHash(Encoding.Default.GetBytes(password)); StringBuilder sb = new StringBuilder(); foreach (byte digestbyte in pwbytes) { sb.Append(digestbyte.ToString("x2")); } String pwdigest = sb.ToString().ToUpper(); MessageBox.Show("Username: "******"\nDigest: " + pwdigest); // TODO: Insert login logic here IsLoggedIn = true; } }
private void loginMenuItem_Click(object sender, EventArgs e) { if (loginForm != null) showError("Login Form is already open"); else { if (currentPlayer == null) { loginForm = new LoginForm(this); loginForm.Show(); } else showError("Error: Please logout first"); } }
public Form_Timing(LoginForm form) { InitializeComponent(); this.form = form; }
private void LoginMenuItem_Click(object sender, EventArgs e) { LoginForm loginForm = new LoginForm(); loginForm.Show(); }