• 大小: 900KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-19
  • 语言: C#
  • 标签: C#winform  

资源简介

C# winform 三层架构设计登陆小模块演示,初学者可以借鉴借鉴。没有放数据库,自己可以自行创建。

资源截图

代码片段和文件信息

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

using testvswinform.Model;
using testvswinform.Bll;

namespace testvswinform
{
    public partial class login : Form
    {
        public login()
        {
            InitializeComponent();
        }

        private void btnLogin_Click(object sender EventArgs e)
        {
            userBll _userbll = new userBll();
            userBean _userbean=new userBean();
            _userbean = null;
            _userbean=_userbll.GetLoginBllProc(this.txtName.Text.ToString() this.txtPwd.Text.ToString());
            //userBean _userbean1 = new userBean();
            //_userbean1 = _userbll.(this.txtName.Text.ToString() this.txtPwd.Text.ToString());
            if( _userbean != null )
            {
                MessageBox.Show(“登录成功!“ + this.txtPwd.Text.ToString() “提示“);
            }else
            {
                MessageBox.Show(“登录失败!“ + this.txtPwd.Text.ToString() “提示“);
            }

        }

        private void btnReset_Click(object sender EventArgs e)
        {
            this.txtName.Text = string.Empty;
            this.txtPwd.Text = string.Empty;
            userBll _userbll=new userBll();
            List _userList= _userbll.GetAllUsersBll();
            MessageBox.Show(Convert.ToString(_userList.Count)“提示“);
        }

        private void label3_Click(object sender EventArgs e)
        {
            Close();
        }


    }
}
/**
 
 
 warduserBll _wuBll = new warduserBll();
        List _wuserList = _wuBll.GetAllUsersBll();
        foreach (warduserBean _wbBean in _wuserList)
        {
            this.lnameLst.Items.Add(_wbBean.WName.ToString());
            //(_wbBean.WName.ToString()) ;
            //_wbBean.WId.ToString());
        }//Response.Write(“alert(‘“ + ex.Message.ToString() + “‘)ript>“);
 
 protected void btn_login_Click(object sender EventArgs e)
    {
        if (this.tpassagain.Text == Session[“image“].ToString())
        {
            //Convert.ToInt32()强制转换成整型
            string Lname = this.lnameLst.SelectedItem.Value.Trim().ToString();
            string Lpass = this.lpass.Text.Trim().ToString();
            //FormsAuthentication.HashPasswordForStoringInConfigFile(this.lpass.Text.Trim().ToString()“MD5“);
            warduserBll _LuserBll=new warduserBll();
            warduserBean _LuserBean = _LuserBll.GetLoginBll(Lname Lpass);
            if (_LuserBean == null)
            {
                lpass.Text = ““;
                tpassagain.Text = ““;
                Response.Write(“ript>alert(‘密码错误!‘)ript>“);
            }
            else
            {
                Session[“LoginName“] = _LuserBean.WName.ToString();
                Session[“LoginPwd“] = _LuserBean.WPwd.ToString();
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-02-24 08:00  testvswinform\
     目录           0  2017-02-24 08:00  testvswinform\testvswinform\
     文件         191  2017-02-21 09:54  testvswinform\testvswinform\App.config
     目录           0  2017-02-24 08:00  testvswinform\testvswinform\Bll\
     文件        4969  2017-02-24 07:51  testvswinform\testvswinform\Bll\userBll.cs
     目录           0  2017-02-24 08:00  testvswinform\testvswinform\DAL\
     文件        8168  2017-02-23 17:09  testvswinform\testvswinform\DAL\DBHelper.cs
     文件        3418  2017-02-23 16:11  testvswinform\testvswinform\DAL\userDao.cs
     目录           0  2017-02-24 08:00  testvswinform\testvswinform\Model\
     文件        2341  2017-02-23 15:44  testvswinform\testvswinform\Model\userBean.cs
     文件         494  2017-02-23 08:31  testvswinform\testvswinform\Program.cs
     目录           0  2017-02-24 08:00  testvswinform\testvswinform\Properties\
     文件        1368  2017-02-21 09:46  testvswinform\testvswinform\Properties\AssemblyInfo.cs
     文件        2876  2017-02-21 09:46  testvswinform\testvswinform\Properties\Resources.Designer.cs
     文件        5612  2017-02-21 09:46  testvswinform\testvswinform\Properties\Resources.resx
     文件        1098  2017-02-21 09:46  testvswinform\testvswinform\Properties\Settings.Designer.cs
     文件         249  2017-02-21 09:46  testvswinform\testvswinform\Properties\Settings.settings
     文件       32038  2012-07-02 10:40  testvswinform\testvswinform\appicon.ico
     目录           0  2017-02-24 08:00  testvswinform\testvswinform\bin\
     目录           0  2017-02-24 08:00  testvswinform\testvswinform\bin\Debug\
     文件       45568  2017-02-24 07:59  testvswinform\testvswinform\bin\Debug\testvswinform.exe
     文件         191  2017-02-21 09:54  testvswinform\testvswinform\bin\Debug\testvswinform.exe.config
     文件       46592  2017-02-24 07:59  testvswinform\testvswinform\bin\Debug\testvswinform.pdb
     文件       14328  2017-03-24 10:47  testvswinform\testvswinform\bin\Debug\testvswinform.vshost.exe
     文件         191  2017-02-21 09:54  testvswinform\testvswinform\bin\Debug\testvswinform.vshost.exe.config
     文件         490  2009-06-11 05:14  testvswinform\testvswinform\bin\Debug\testvswinform.vshost.exe.manifest
     目录           0  2017-02-24 08:00  testvswinform\testvswinform\img\
     文件        2238  2017-02-22 15:34  testvswinform\testvswinform\img\Crescent.ico
     文件         766  2017-02-22 15:34  testvswinform\testvswinform\img\Delete1.ico
     文件        1078  2017-02-22 15:34  testvswinform\testvswinform\img\Delete2.ico
     文件        2238  2017-02-22 15:34  testvswinform\testvswinform\img\FALLING.ICO
............此处省略121个文件信息

评论

共有 条评论