摘要: winform 窗体Form2里面,点击窗体右上角“X”关闭窗体,跳到上一个界面Form1这里有两种方法:一个是重写OnClosing方法;另一个是点击窗体事件FormClosing;一、重写OnClosing方法 protected override void OnClosing(CancelEventArgs e) { e.Cancel = true; Form1 f = new Form1(); f.Show(); this.Hide(); }二、点击窗体事件FormClosing private void Form2_FormClosing(object sender, FormClo 阅读全文
posted @ 2011-08-11 16:34 欧阳三寿 阅读(2639) 评论(0) 推荐(2) 编辑
摘要: 登录一般有两种方法:一种是字符串拼接的方法;另一种是参数法。一、字符串拼接法 SqlConnection con = new SqlConnection("Server=.;database=CESAW;Integrated Security=true;"); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "Select * from UserInfo where UserName='" + textBox1.Text.Trim() + &qu 阅读全文
posted @ 2011-08-11 15:47 欧阳三寿 阅读(572) 评论(0) 推荐(1) 编辑