基于net_的三成架构的网上评分系统课程设计(编辑修改稿)内容摘要:

{ if (c == 0) { (用户主页 .aspx)。 } else if (c == 1) { (管理员主页 .aspx)。 } } else { ()。 } } else { ()。 } ()。 //关闭连接 } protected void Button2_Click(object sender, EventArgs e) { ()。 } } 注册模块的具体设计代码如下图所示: using。 using。 using。 using。 using。 using。 using。 using。 public partial class register : { int a。 protected void Page_Load(object sender, EventArgs e) { a = (Session[power])。 网上投票系统 8 } protected void Button1_Click(object sender, EventArgs e) { SqlConnection oCon = ()。 string insertString = INSERT INTO yonghu ( userid,passwd,power) values(39。 + + 39。 , 39。 + + 39。 ,0)。 string insertString2 = INSERT INTO isvote(userid,isvote1,isvote2) values(39。 + + 39。 , 0,0)。 SqlCommand cmd = new SqlCommand(insertString, oCon)。 SqlCommand cmd2 = new SqlCommand(insertString2, oCon)。 ()。 ()。 ()。 ()。 if (a == 1) { (管理员主页 .aspx)。 } else { ()。 } } } 投票模块 该模块可以为两个主题投票,其中一个主题是“三好学生”的评选,另一个是“你最喜欢的歌手”的评选。 “三好学生”的评选的具体设计代码如下所示: using System。 using。 using。 using。 using。 using。 using。 using。 using。 using。 using。 public partial class Default2 : { int c, d, a, i, n。 string m。 protected void Page_Load(object sender, EventArgs e) { m = (string)(Session[userid])。 n = (int)(Session[power])。 } protected void Button1_Click(object sender, EventArgs e) { quzhi()。 c = (int)(Session[isvote1])。 if (n == 0) 网上投票系统 9 { if (c == 0) { for (i = 0。 i = 1。 i++) { CheckBox chk = (CheckBox)([i].FindControl(checkbox1))。 if () { d = d + 1。 } } sw()。 } else { ()。 } } else { ()。 } } public void sw() //此方法用于检验投 票次数 { if (d == 0) { ()。 } else if (d 6) { for (i = 0。 i = 1。 i++) { CheckBox chk = (CheckBox)([i].FindControl(checkbox1))。 if () { db()。 } } (vote1投票结果 .aspx)。 } else if (d 5) { ()。 } } public void db() //投票计数操作,并且将用户投票状态改变 { a = ([i].Cells[0].Text)。 int b = ([i].Cells[2].Text) + 1。 CheckBox chk = (CheckBox)([i].FindControl(checkbox1))。 SqlConnection CON = new SqlConnection(Data Source=.。 Initial Catalog=VoteDB。 Integrated Security=True)。 string updatestring1 = update vote1 set sum=@sum。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。