⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sms_login.cs

📁 库存管理系统,对企业仓库的产品进行管理,使用C#语句 .net 平台开发
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace FORU_SMS_
{
    public partial class SMS_Login : Form
    {
        BaseClass.DataConn Dconn = new FORU_SMS_.BaseClass.DataConn();
        BaseClass.DataClass Dclass = new FORU_SMS_.BaseClass.DataClass();
        public SqlCommand sqlcom;
        private string testValue;
        public static SMS_Login login;
        public SMS_Login()
        {
            InitializeComponent();
            login = this;
        }

        public string TestValue
        {
            get
            {
                return testValue;
            }
            set
            {
                this.testValue = value;
            }
        }

        private void bt_ok_Click(object sender, EventArgs e)
        {
            string txtName = com_User.Text.Trim();
            string txtPass = txt_Pass.Text.Trim();
            bool strEnter = Dclass.ChkLogin(txtName, txtPass);
            if (strEnter != true)
            {
                MessageBox.Show("登陆名或密码错误!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                this.TestValue = txtName;
                SMS_Main main = new SMS_Main();
                main.Show();
                this.Visible = false;
                MessageBox.Show("成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void SMS_Login_Load(object sender, EventArgs e)
        {
           Dclass.BindComboBox("select UserName from SMS_User", "SMS_User", "UserName", com_User);
           //MessageBox.Show(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); 时间表示
        }

        private void bt_canel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void txt_Pass_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                this.bt_ok.Focus();
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -