您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 经营企划 > ASPNET课程设计
课程名称:ASP.NET课程设计姓名:刘阳学号:201230330219所在专业:软件工程所在院系:信息工程学院辅导教师:宁星日期:2015年1月15日目录一、课程设计的目的·······························1二、课程设计要求·································1三、课题及内容···································1四、流程图·······································2五、数据库·······································2六、页面代码·····································31、登陆页面······································32、用户中心页面··································53、个人信息页面··································94、首页页面·····································135、注册页面·····································176、发布信息页面·································197、聊天室页面···································21七、课程设计小结································231一、课程设计的目的通过利用Asp.net进行web应用程序的设计与开发,加深对web程序开发的基本知识的理解,掌握动态页面设计的基本方法和步骤,掌握程序调试的一般方法和技巧。培养基本理论分析、解决实际问题的能力及锻炼写设计总结报告的能力。二、课程设计的基本要求1.本课程设计要求学生用Asp.net技术开发一个动态网站,利用B/S结构,能将客户端的用户请求提交给服务器端的程序处理。服务器端程序能完成数据的插入、删除、更新以及将用户请求的查询数据返回客户端。2.课程设计结束后,每位同学独立提交一份web课程设计报告,内容包括总体设计和算法分析,主要流程,测试数据及测试过程,遇到的问题及解决方法等3.界面截图里要有代表性的数据。三、课程设计的内容题目:基于Web的房屋出租信息发布系统功能要求:1.用户管理功能,包括:用户注册,登录认证,修改个人信息;22.房屋出租信息发布:注册用户登录后可发布,查询,修改,删除自己发布的房屋出租信息;3.房屋信息查询:游客可按房屋类型,所处街道或出租价格查询相应的房屋出租信息。4.简易论坛或聊天室四、流程图五、数据库SQLServer中数据库里建立了三张表,分别是User表(用户信息表)、Fw表(房屋出租信息表)和chat表(聊天记录登陆页面用户登陆游客登陆个人中心用户注册删除发布进入首页个人信息发布信息进入聊天室3表)。1.User表中字段:id,pwd,name,sex2.Fw表中字段:id,编号,类型,街道,价格3.chat表中字段:id,stext,stime六、页面代码1、登陆页面前端代码:%@PageLanguage=VBAutoEventWireup=falseCodeFile=ulogin.aspx.vbInherits=_Default%!DOCTYPEhtmlPUBLIC-//W3C//DTDXHTML1.0Transitional//EN==servertitle/title/headbodycenterh1房屋出租系统/h1formid=form1runat=serverasp:LabelID=Label1runat=serverText=用户名:4/asp:Labelasp:TextBoxID=idtextrunat=server/asp:TextBoxbr/br/asp:LabelID=Label2runat=serverText=密码:/asp:Labelasp:TextBoxID=pwdtextrunat=servertextmode=password/asp:TextBoxbr/br/asp:ButtonID=youkerunat=serverText=游客/asp:ButtonID=loginrunat=serverText=登录/br/br/asp:ButtonID=uzcrunat=serverText=注册//form/center/body/html后台代码:ImportsSystem.Data.SqlClientImportsSystem.DataPartialClass_DefaultInheritsSystem.Web.UI.PageProtectedSublogin_Click(senderAsObject,eAsEventArgs)Handleslogin.ClickDimidAsString=idtext.Text.Trim()DimpwdAsString=pwdtext.Text.Trim()DimconnAsNewSqlConnection(server=.;database=fwcz;uid=sa;pwd=91569;)DimsqltextAsString=select*from[User]whereid='+id+'andpwd='+pwd+'Tryconn.Open()DimsqlcomAsSqlCommand=NewSqlCommand(sqltext,conn)Ifsqlcom.ExecuteScalar()NothingThenSession.Add(login_name,id)conn.Close()Response.Redirect(user.aspx)ElseResponse.Write(scriptalert('账号密码错误!')/script)EndIfIfconn.State=ConnectionState.OpenThenconn.Close()EndIfCatchexAsException5EndTryEndSubProtectedSubuzc_Click(senderAsObject,eAsEventArgs)Handlesuzc.ClickResponse.Redirect(uzc.aspx)EndSubProtectedSubyouke_Click(senderAsObject,eAsEventArgs)Handlesyouke.ClickSession.Add(login_name,guest)Response.Redirect(main.aspx)EndSubEndClass2、用户中心页面前端代码:%@PageLanguage=VBAutoEventWireup=falseCodeFile=user.aspx.vbInherits=user%!DOCTYPEhtmlhtmlxmlns==server6metahttp-equiv=Content-Typecontent=text/html;charset=utf-8/title/title/headbodycenterformid=form1runat=serverh2用户中心/h2asp:LabelID=Label1runat=serverText=请重新登陆!ForeColor=#0033CC/asp:Labelbr/br/asp:LabelID=Label2runat=serverText=Label/asp:Labelbr/br/根据编号:asp:TextBoxID=TextBox1runat=server/asp:TextBoxasp:ButtonID=Button5runat=serverText=删除style=height:21px/asp:Buttonbr/br/asp:ButtonID=Button2runat=serverText=首页/asp:Buttonasp:ButtonID=Button3runat=serverText=发布/asp:Buttonbr/br/asp:ButtonID=Button1runat=serverText=个人信息/asp:Buttonasp:ButtonID=Button4runat=serverText=聊天室/asp:Buttonbr//form/center/body/html后台代码:ImportsSystem.Data.SqlClientImportsSystem.DataPartialClassuserInheritsSystem.Web.UI.PageProtectedSubPage_Load(senderAsObject,eAsEventArgs)HandlesMe.LoadIf(Session(login_name)Nothing)Then7DimidAsString=Session(login_name).ToString()Label1.Text=id+欢迎您!您的发布如下:DimconnAsNewSqlConnection(server=.;database=fwcz;uid=sa;pwd=91569;)DimsqltextAsString=select*from[Fw]whereid='+id+'conn.Open()DimsqlcmdAsSqlCommand=NewSqlCommand(sqltext,conn)DimobjectreaderAsSqlDataReaderDimiAsIntegerDimfwAsStringobjectreader=sqlcmd.ExecuteReader()fw=tableborder=2fw+=trFori=0Toobjectreader.FieldCount-1fw+=td+objectreader.GetName(i)+/tdNextfw+=/trWhileobjectreader.Read()fw+=trFori=0Toobjectreader.FieldCount-1fw+=td+CStr(objectreader.GetValue(i))+/tdNextfw+=/trEndWhilefw+=/tableLabel2.Text=fwconn.Close()Else:Response.Write(scriptalert('用户过期,请重新登陆!');window.location.href='ulogin.aspx'/script)EndIfEndSubProtectedSubButton1_Click(senderAsObject,eAsEventArgs)HandlesButton1.ClickResponse.Redirect(userinfo.aspx)EndSubProtectedSubButton2_Click(senderAsObject,eAsEventArgs)HandlesButton2.ClickResponse.Redirect(main.aspx)EndSubProtectedSubButton3_Cli
本文标题:ASPNET课程设计
链接地址:https://www.777doc.com/doc-2214361 .html