private void F_Login_Load(object sender, EventArgs e) { try { MyClass.con_open(); //连接数据库 MyClass.con_close(); //textName.Text = ""; //textPass.Text = ""; } catch (Exception objException) { MessageBox.Show("数据库连接失败。" + objException.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); } }
private void F_Login_Load(object sender, EventArgs e) { try { MyClass.con_open(); //连接数据库 MyClass.con_close(); txt_name.Text = ""; txt_password.Text = ""; } catch { MessageBox.Show("数据库连接失败。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); } }