非常急。。。。。。。。。。。。。。。。。 怎么在显示一个登陆form,验证通过后再进入主界面form 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void OKbtn_Click(object sender, System.EventArgs e) { try { if(this.txt1.Text=="admin") { SqlConnection Myconn = new SqlConnection("Data Source=(local);Integrated Security=SSPI;"+"Initial Catalog=sellmanager"); Myconn.Open(); if(this.txt2.Text=="admin") { this.Visible=false; Myconn.Close(); FrAdminMain Form=new FrAdminMain(); Form.ShowDialog(); //Form2 fr=new Form2(); //fr.ShowDialog(); } else { MessageBox.Show("用户名或密码有错!","错误信息",MessageBoxButtons.OK,MessageBoxIcon.Information); } } else { SqlConnection Myconn = new SqlConnection("Data Source=(local);Integrated Security=SSPI;"+"Initial Catalog=sellmanager"); Myconn.Open(); SqlCommand Mycomm=Myconn.CreateCommand(); Mycomm.CommandText="select sellID,psd from sellerinfo where sellID='"+this.txt1.Text+"'and psd='"+DataProdected.Encrypt(this.txt2.Text,"licesoft")+"'"; SqlDataReader MyReader=Mycomm.ExecuteReader(); if(MyReader.Read()) { Myconn.Close(); MyReader.Close(); this.Visible=false; FrUserMain Form=new FrUserMain(this.txt1.Text); Form.ShowDialog(); } else { MessageBox.Show("用户名或密码有错!","错误信息",MessageBoxButtons.OK,MessageBoxIcon.Information); } MyReader.Close(); } } catch(Exception err) { MessageBox.Show(err.ToString()); } } 关于调用API函数CreateFile打开LPT1端口的问题!!急盼解答! 菜鸟急切求助C#或者python实现 如何先提示信息后,再转到其它页面? Convert.IsDBNull 向高手请教:listview 的行移动后,其行的背景颜色没了 如何按回车自动跳道下个text 怎么传递字符串。。。。急!!! 姐姐哥哥妹妹弟弟帮忙 不同网站共享Session问题 两段代码的比较问题。。。 让标题长起来 请问如何输入多个参数到一个C#控制台应用程序中 如何捕捉DataGrid中的DataGridTextBox输入的回车键? 如何在c#中判断字符为汉字
{
try
{
if(this.txt1.Text=="admin")
{
SqlConnection Myconn = new SqlConnection("Data Source=(local);Integrated Security=SSPI;"+"Initial Catalog=sellmanager");
Myconn.Open();
if(this.txt2.Text=="admin")
{
this.Visible=false;
Myconn.Close();
FrAdminMain Form=new FrAdminMain();
Form.ShowDialog();
//Form2 fr=new Form2();
//fr.ShowDialog();
}
else
{
MessageBox.Show("用户名或密码有错!","错误信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
else
{
SqlConnection Myconn = new SqlConnection("Data Source=(local);Integrated Security=SSPI;"+"Initial Catalog=sellmanager");
Myconn.Open();
SqlCommand Mycomm=Myconn.CreateCommand();
Mycomm.CommandText="select sellID,psd from sellerinfo where sellID='"+this.txt1.Text+"'and psd='"+DataProdected.Encrypt(this.txt2.Text,"licesoft")+"'";
SqlDataReader MyReader=Mycomm.ExecuteReader();
if(MyReader.Read())
{
Myconn.Close();
MyReader.Close();
this.Visible=false;
FrUserMain Form=new FrUserMain(this.txt1.Text);
Form.ShowDialog();
}
else
{
MessageBox.Show("用户名或密码有错!","错误信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
MyReader.Close();
}
}
catch(Exception err)
{
MessageBox.Show(err.ToString());
}
}