分享

在winform里c#验证用户正确后 怎么打开新窗口时关闭登陆窗口_轻舟水上飘~

 COPY&PASTE 2009-10-04

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MarkingSystem
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }
       
        private void Login_Load(object sender, EventArgs e)
        {
          
        }

        private void Cancel_Click(object sender, EventArgs e)
        {
            Close();
        }
        private void LoginButton_Click(object sender, EventArgs e)
        {
            if (UserName.Text == "")
            {
                MessageBox.Show("请输入用户名!", "输入提示", MessageBoxButtons.OK);
                UserName.Focus();
            }
            else if (Pwd.Text == "")
            {
                MessageBox.Show("请输入密码!", "输入提示", MessageBoxButtons.OK);
                Pwd.Focus();
            }
            else if (UserName.Text.Equals("Admin") && Pwd.Text.Equals("123"))
            {              
                Pwd.Text = "";
                this.Hide();
                mark m =new mark();
                m.ShowDialog();
                this.Close();

            } 
            else
            {
                MessageBox.Show("您输入的用户名或密码错误","错误提示",MessageBoxButtons.OK);
                Pwd.Focus();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("用户名 Admin,密码 123");
        }
    }
}

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多