欢迎来到天天文库
浏览记录
ID:41845621
大小:489.66 KB
页数:16页
时间:2019-09-03
《web管理系统课程设计》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、湖犹第二师范曇院«Web程序设计》课程设计报告书班级:12级计算机应用技术(1)班学号:姓名:指导老师:王海军成绩:简单的Web应用系统设计.开发一•登录页面:登录页而的设计与代码:主要以不同的角色进去就会跳进不同的页面就会有不同的权限源代码:后台代码:usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSys
2、tem.Web.UI;usingSystem.Web.ULWebControls;usingSystem.Web.Ul.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Data.SqlClient;publicpartialclasslogin1:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse)Label7.Text二”当前时间是:"+Dat
3、eTime.Now.ToStringO;protectedvoidButtonl_Click(objectsender,EventArgse)if(rbtstudent.Checked==false&&rbtteacher.Checked==false){Response.Write("n);}else{if(rbtstudent.Checked==true){SqlConnectioncon=newSqlConnection(nse
4、rvei-.;database=school;integratedsecurity二SSPIJ;con.Open();SqlCommandcmd=newSqlCommand();cmd-Connection=con;cmd.CommandText=八select*fromstudentwherestdid-M+username.Text+,nandstdmm=n,+useipwd.Text+//cmd.CommandText="select*fromachievementwherestdid=M,+use
5、rname.Text+HH,;SqlDataReaderdr=cmd.ExecuteReader();if(dr.Read()){Session[nstdidn]=dr[O];Session["stdnun"]=drf'stdmm"];Session["stdxbM]=dr["stdxb"J;Session[,'stdsfz,,J=dr["stdsfzn];Session[HstdrxsjH]=dr["stdrxsjn];Session[,,stdbj,,J=dr[ustdbjM];Session["st
6、ddz"]=dr["stddz"];Session[nstddhH]=drlnstddhu];Session["stdxmu]=dr["stdxm"];username.Text=Session["stdid"].ToStringO;userpwd.Text=Session[',stdmmH].ToStringO;Label4.Text=n登陆成功”;username.Text="";//userID为textbox1username.Enabled=false;userpwd.Text="”;//use
7、rPWD为textbox?userpwd.Enabled=false;dr.Close();Response.Redirect("students/学生主页.aspx");//Response.Write(MH);}else{Response.Write(u");//Label4.Text=”用户名或密码不正当确,请重新输入”;con.Close();}}
8、if(rbtteacher.Checked二二true){SqlConnectioncon=newSqlConnection(Hservei-.;database=school;integratedsecurity二SSPI");con.Open();SqlCommandcmd=newSqlCommand();cmd.Connection=con;cmd.CommandText="select*fromteacherswher
此文档下载收益归作者所有