您现在的位置是:主页 > news > 亚洲杯篮球直播在什么网站/做网站的步骤

亚洲杯篮球直播在什么网站/做网站的步骤

admin2025/6/6 18:17:07news

简介亚洲杯篮球直播在什么网站,做网站的步骤,百度seo自动优化,常德网站建设厦门网站制作这些天忙着其他事情好久没来博客园看了,新增一篇博客也算是对项目进度的鞭策吧。 第一步打开文件新建一个项目为空白解决方案,选择保存位置; 第二在解决方案名称上单击鼠标右键,在弹出的快捷菜单中选择"添加"→"新…

亚洲杯篮球直播在什么网站,做网站的步骤,百度seo自动优化,常德网站建设厦门网站制作这些天忙着其他事情好久没来博客园看了,新增一篇博客也算是对项目进度的鞭策吧。 第一步打开文件新建一个项目为空白解决方案,选择保存位置; 第二在解决方案名称上单击鼠标右键,在弹出的快捷菜单中选择"添加"→"新…

这些天忙着其他事情好久没来博客园看了,新增一篇博客也算是对项目进度的鞭策吧。

第一步打开文件新建一个项目为空白解决方案,选择保存位置;

第二在解决方案名称上单击鼠标右键,在弹出的快捷菜单中选择"添加"→"新建项目",选择window应用窗体程序;

第三同样的步骤,打开新建项目,选择类库分别建立实现数据访问层、业务逻辑访问层、模型层。

第四三层结构的基本框架已经搭建成功,但是各层之间是独立的,只有添加依赖关系,才能让它们相互协作;

添加表示层对业务逻辑层及模型层的依赖,业务逻辑层中添加对数据访问层和模型层的依赖,以及数据访问层对模型层的依赖。

上图:

到此三层结构及各层之间的依赖关系创建完毕,下面实现登录功能:

模型层:

View Code
 public class User{public User() { }public int id;public int Id{get { return id; }set { id = value; }}public string Loginname;private string LoginName{get { return Loginname; }set { Loginname = value; }}public string Loginpwd;private string LoginPwd{get { return Loginpwd; }set { Loginpwd = value; }}public string Logincount;private string LoginCount{get { return Logincount; }set { Logincount = value; }}public string Logintime;private string LoginTime{get { return Logintime; }set { Logintime = value; }}public string Loginip;private string LoginIp{get { return Loginip; }set { Loginip = value; }}}

数据访问层:

View Code
 public static User GetLoginDal(string uid,string pwd){string strsql = "select * from [user] where username='" + uid + "' and password ='" + pwd + "'";using(SqlDataReader reader=Sqlhelper.GetReader(strsql)){if (reader.Read()){User user = new User();user.Loginname = (string)reader["username"];user.Loginpwd = (string)reader["password"];user.Logincount = reader["Logincount"].ToString();user.Logintime = reader["Logintime"].ToString();user.Loginip = (string)reader["ipaddress"];reader.Close();return user;}else{reader.Close();return null;}};}

业务逻辑层:

View Code
 public static class UserBLL{public static bool GetloginBll(string uid,string pwd){User user = WFCenter.DAL.UserDal.GetLoginDal(uid, pwd);if (user.Loginpwd == pwd){return true;}else{return false;}}}

应用层:

View Code
 private void Btn1_Click(object sender, EventArgs e){if (this.textBox1.Text.Trim().Length == 0){MessageBox.Show("用户名不能为空!");}if (this.textBox2.Text.Trim().Length == 0){MessageBox.Show("密码不能为空!");}if (UserBLL.GetloginBll(textBox1.Text, textBox2.Text)){WFCenter wfc = new WFCenter();this.Visible = false;wfc.ShowDialog();this.Close();}}

登录界面显示界面:

至此整个上位机3层结构设计完成,个人觉得作为一个项目负责人

第一整个软件框架要打好,风格要确立;

第二不要急于编码,先把功能模块化,然后分给手下做;

第三少加点班,多看看博客园,哈哈。

希望各位砖家抛砖引玉。。。。