| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 519 人关注过本帖
标题:请求帮助~~~界面登陆问题
只看楼主 加入收藏
hcx888
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2013-4-17
结帖率:70%
收藏
已结贴  问题点数:20 回复次数:4 
请求帮助~~~界面登陆问题
信息管理系统.rar (145.79 KB)


一开始先不注册的时候,直接输入账户,密码。不能报错 “不存在账户”!!
搜索更多相关主题的帖子: 密码 注册 
2013-04-17 19:13
yhlvht
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:36
帖 子:707
专家分:4405
注 册:2011-9-30
收藏
得分:0 
既然如此,那注册的意义何在啊,你不判断账户密码,直接进不就可以了
2013-04-17 19:32
hcx888
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2013-4-17
收藏
得分:0 
回复 2楼 yhlvht
那QQ还不是一样,没注册就会显示不存在 账户
2013-04-17 19:37
yhlvht
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:36
帖 子:707
专家分:4405
注 册:2011-9-30
收藏
得分:20 
private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                if (textBox1.Text == "" || textBox2.Text == "")
                {
                    MessageBox.Show("\n\n登录失败\n\n请填写好登录信息!!");
                }
                else if (PublicS.listS.Count == 0)
                {
                    MessageBox.Show("\n\n登录失败\n\n请先注册!!");
                }
                else
                {
                    IEnumerable<Student1> ie = PublicS.listS.Where((Student1 stu) => stu.Num == textBox1.Text);
                    if (ie.Count() > 0)
                    {
                        Student1 stu1 = ie.First();
                        if (textBox2.Text != stu1.Spw1)
                        {
                            MessageBox.Show("\n\n密码错误!");
                            textBox2.Text = "";
                        }
                        else
                        {
                            StudentBox To = new StudentBox();
                            To.Show();
                            this.Hide();
                        }
                    }
                    else
                    {
                        MessageBox.Show("\n\n学生号不存在!");
                        textBox1.Text = "";
                        textBox2.Text = "";
                    }
                }
                //else if (textBox1.Text != PublicS.listS[0].Num)
                //{
                //    MessageBox.Show("\n\n学生号不存在!");
                //    textBox1.Text = "";
                //    textBox2.Text = "";
                //}
                //else if (textBox2.Text != PublicS.listS[0].Spw1)
                //{
                //    MessageBox.Show("\n\n密码错误!");
                //    textBox2.Text = "";
                //}
                //else if (textBox1.Text == PublicS.listS[0].Num && textBox2.Text == PublicS.listS[0].Spw1)
                //{
                //    StudentBox To = new StudentBox();
                //    To.Show();
                //    this.Hide();
                //}
            }
            if (radioButton2.Checked == true)
            {

                if (textBox1.Text == "" || textBox2.Text == "")
                {
                    MessageBox.Show("\n\n登录失败\n\n请填写好登录信息!!");
                }
                else if (PublicT.listT.Count == 0)
                {
                    MessageBox.Show("\n\n登录失败\n\n请先注册!!");
                }
                else
                {
                    IEnumerable<Teacher1> ie = PublicT.listT.Where((Teacher1 teach) => teach.Num == textBox1.Text);
                    if (ie.Count() > 0)
                    {
                        Teacher1 tech1 = ie.First();
                        if (textBox2.Text != tech1.Spw1)
                        {
                            MessageBox.Show("\n\n密码错误!");
                            textBox2.Text = "";
                        }
                        else
                        {
                            TeacherBox To = new TeacherBox();
                            To.Show();
                            this.Hide();
                        }
                    }
                    else
                    {
                        MessageBox.Show("\n\n教工号不存在!");
                        textBox1.Text = "";
                        textBox2.Text = "";
                    }
                }
                //else if ( textBox1.Text != PublicT.listT[0].Num)
                //{
                //    MessageBox.Show("\n\n教工号不存在!");
                //    textBox1.Text = "";
                //    textBox2.Text = "";
                //}
                //else if (textBox2.Text != PublicT.listT[0].Spw1)
                //{
                //    MessageBox.Show("\n\n密码错误!");
                //    textBox2.Text = "";
                //}
                //else if (textBox1.Text == PublicT.listT[0].Num && textBox2.Text == PublicT.listT[0].Spw1)
                //{
                //    TeacherBox To = new TeacherBox();
                //    To.Show();
                //    this.Hide();
                //}
            }
        }
2013-04-17 21:55
hcx888
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2013-4-17
收藏
得分:0 
回复 4楼 yhlvht
非常感谢
2013-04-17 22:00
快速回复:请求帮助~~~界面登陆问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.043136 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved