ASPNET课程设计.docx

上传人:b****6 文档编号:14039003 上传时间:2023-06-20 格式:DOCX 页数:31 大小:277.56KB
下载 相关 举报
ASPNET课程设计.docx_第1页
第1页 / 共31页
ASPNET课程设计.docx_第2页
第2页 / 共31页
ASPNET课程设计.docx_第3页
第3页 / 共31页
ASPNET课程设计.docx_第4页
第4页 / 共31页
ASPNET课程设计.docx_第5页
第5页 / 共31页
ASPNET课程设计.docx_第6页
第6页 / 共31页
ASPNET课程设计.docx_第7页
第7页 / 共31页
ASPNET课程设计.docx_第8页
第8页 / 共31页
ASPNET课程设计.docx_第9页
第9页 / 共31页
ASPNET课程设计.docx_第10页
第10页 / 共31页
ASPNET课程设计.docx_第11页
第11页 / 共31页
ASPNET课程设计.docx_第12页
第12页 / 共31页
ASPNET课程设计.docx_第13页
第13页 / 共31页
ASPNET课程设计.docx_第14页
第14页 / 共31页
ASPNET课程设计.docx_第15页
第15页 / 共31页
ASPNET课程设计.docx_第16页
第16页 / 共31页
ASPNET课程设计.docx_第17页
第17页 / 共31页
ASPNET课程设计.docx_第18页
第18页 / 共31页
ASPNET课程设计.docx_第19页
第19页 / 共31页
ASPNET课程设计.docx_第20页
第20页 / 共31页
亲,该文档总共31页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

ASPNET课程设计.docx

《ASPNET课程设计.docx》由会员分享,可在线阅读,更多相关《ASPNET课程设计.docx(31页珍藏版)》请在冰点文库上搜索。

ASPNET课程设计.docx

ASPNET课程设计

课程名称:

课程设计

姓名:

刘阳

学号:

0219

所在专业:

软件工程

所在院系:

信息工程学院

辅导教师:

宁星

日期:

2015年1月15日

 

一、课程设计的目的·······························1

二、课程设计要求·································1

三、课题及内容···································1

四、流程图·······································2

五、数据库·······································2

六、页面代码·····································3

七、课程设计小结································23

 

一、课程设计的目的

通过利用进行web应用程序的设计与开发,加深对web程序开发的基本知识的理解,掌握动态页面设计的基本方法和步骤,掌握程序调试的一般方法和技巧。

培养基本理论分析、解决实际问题的能力及锻炼写设计总结报告的能力。

二、课程设计的基本要求

1.本课程设计要求学生用技术开发一个动态网站,利用B/S结构,能将客户端的用户请求提交给服务器端的程序处理。

服务器端程序能完成数据的插入、删除、更新以及将用户请求的查询数据返回客户端。

2.课程设计结束后,每位同学独立提交一份web课程设计报告,内容包括总体设计和算法分析,主要流程,测试数据及测试过程,遇到的问题及解决方法等

3.界面截图里要有代表性的数据。

三、课程设计的内容

题目:

基于Web的房屋出租信息发布系统

功能要求:

1.用户管理功能,包括:

用户注册,登录认证,修改个人信息;

2.房屋出租信息发布:

注册用户登录后可发布,查询,修改,删除自己发布的房屋出租信息;

3.房屋信息查询:

游客可按房屋类型,所处街道或出租价格查询相应的房屋出租信息。

4.简易论坛或聊天室

四、流程图

登陆页面

用户登陆

游客登陆

个人中心

用户注册

删除发布

进入首页

个人信息

发布信息

进入聊天室

 

五、数据库

SQLServer中数据库里建立了三张表,分别是User表(用户信息表)、Fw表(房屋出租信息表)和chat表(聊天记录表)。

表中字段:

id,pwd,name,sex

表中字段:

id,编号,类型,街道,价格

表中字段:

id,stext,stime

六、页面代码

1、登陆页面

前端代码:

<%@PageLanguage="VB"AutoEventWireup="false"CodeFile=""Inherits="_Default"%>

DOCTYPEhtmlPUBLIC"-database=fwcz;uid=sa;pwd=91569;")

DimsqltextAsString="select*from[User]whereid='"+id+"'andpwd='"+pwd+"'"

Try

()

DimsqlcomAsSqlCommand=NewSqlCommand(sqltext,conn)

If()<>NothingThen

("login_name",id)

()

("")

Else

("")

EndIf

If=Then

()

EndIf

CatchexAsException

EndTry

EndSub

ProtectedSubuzc_Click(senderAsObject,eAsEventArgs)Handles

("")

EndSub

ProtectedSubyouke_Click(senderAsObject,eAsEventArgs)Handles

("login_name","guest")

("")

EndSub

EndClass

2、用户中心页面

前端代码:

<%@PageLanguage="VB"AutoEventWireup="false"CodeFile=""Inherits="user"%>

DOCTYPEhtml>

用户中心

LabelID="Label1"runat="server"Text="请重新登陆!

"ForeColor="#0033CC">

Label>



LabelID="Label2"runat="server"Text="Label">

Label>



根据编号:

TextBoxID="TextBox1"runat="server">

TextBox> 

ButtonID="Button5"runat="server"Text="删除"style="height:

21px">

Button>



ButtonID="Button2"runat="server"Text=" 首页 ">

Button>

 

ButtonID="Button3"runat="server"Text=" 发布 ">

Button>

ButtonID="Button1"runat="server"Text="个人信息">

Button>

 

ButtonID="Button4"runat="server"Text="聊天室">

Button>


后台代码:

Imports

PartialClassuser

InheritsProtectedSubPage_Load(senderAsObject,eAsEventArgs)Handles

If(Session("login_name")<>Nothing)Then

DimidAsString=Session("login_name").ToString()

=id+"欢迎您!

您的发布如下:

"

DimconnAsNewSqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;")

DimsqltextAsString="select*from[Fw]whereid='"+id+"'"

()

DimsqlcmdAsSqlCommand=NewSqlCommand(sqltext,conn)

DimobjectreaderAsSqlDataReader

DimiAsInteger

DimfwAsString

objectreader=()

fw=""

fw+=""

Fori=0To-1

fw+=""+(i)+""

Next

fw+=""

While()

fw+=""

Fori=0To-1

fw+=""+CStr(i))+""

Next

fw+=""

EndWhile

fw+=""

=fw

()

Else:

("")

EndIf

EndSub

ProtectedSubButton1_Click(senderAsObject,eAsEventArgs)Handles

("")

EndSub

ProtectedSubButton2_Click(senderAsObject,eAsEventArgs)Handles

("")

EndSub

ProtectedSubButton3_Click(senderAsObject,eAsEventArgs)Handles

("")

EndSub

ProtectedSubButton4_Click(senderAsObject,eAsEventArgs)Handles

("")

EndSub

ProtectedSubButton5_Click(senderAsObject,eAsEventArgs)Handles

If(Session("login_name")<>Nothing)Then

DimidAsString=Session("login_name")

DimnAsString=DimconnAsNewSqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;")

DimsqltextAsString="DELETEFROM[Fw]WHEREid='"+id+"'and编号='"+n+"'"

Try

()

DimsqlcomAsSqlCommand=NewSqlCommand(sqltext,conn)

()

()

("")

If=Then

()

EndIf

CatchexAsException

EndTry

EndIf

EndSub

EndClass

 

3、个人信息页面

前端代码:

<%@PageLanguage="VB"AutoEventWireup="false"CodeFile=""Inherits="userinfo"%>

DOCTYPEhtml>

您的个人信息

LabelID="Label10"runat="server"Text="用户名:

"ForeColor="#0033CC">

Label>

LabelID="Label11"runat="server"Text=""ForeColor="#0033CC">

Label>

LabelID="Label6"runat="server"Text="姓名:

"ForeColor="#0033CC">

Label>

LabelID="Label7"runat="server"Text=""ForeColor="#0033CC">

Label>

LabelID="Label8"runat="server"Text="性别:

"ForeColor="#0033CC">

Label>

LabelID="Label9"runat="server"Text=""ForeColor="#0033CC">

Label>

信息完善与修改

LabelID="Label1"runat="server"Text="姓 名:

">

Label>

TextBoxID="TextBox1"runat="server">

TextBox>

LabelID="Label2"runat="server"Text="性 别:

">

Label>

DropDownListID="DropDownList1"runat="server">

ListItemValue="男">

ListItem>

ListItemValue="女">

ListItem>

DropDownList>

ButtonID="Button1"runat="server"Text=" 更新 "style="height:

21px">

Button>

修改密码

LabelID="Label3"runat="server"Text="原密码:

">

Label>

TextBoxID="oldpwd"runat="server"textmode="password">

TextBox>

LabelID="Label4"runat="server"Text="新密码:

">

Label>

TextBoxID="newpwd1"runat="server"textmode="password">

TextBox>

LabelID="Label5"runat="server"Text="新密码:

">

Label>

TextBoxID="newpwd2"runat="server"textmode="password">

TextBox>

ButtonID="Button2"runat="server"Text=" 修改 ">

Button>

后台代码:

Imports

PartialClassuserinfo

InheritsProtectedSubButton1_Click(senderAsObject,eAsEventArgs)Handles

If(Session("login_name")<>Nothing)Then

DimidAsString=Session("login_name")

DimnAsString=DimsAsString=

DimconnAsNewSqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;")

DimsqltextAsString="update[User]setname='"+n+"',sex='"+s+"'whereid='"+id+"'"

Try

()

DimsqlcomAsSqlCommand=NewSqlCommand(sqltext,conn)

()

()

("")

If=Then

()

EndIf

CatchexAsException

EndTry

EndIf

EndSub

ProtectedSubPage_Load(senderAsObject,eAsEventArgs)Handles

If(Session("login_name")<>Nothing)Then

DimidAsString=Session("login_name")

=id

DimconnAsNewSqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;")

Dimsqltext1AsString="selectnamefrom[User]whereid='"+ID+"'"

Dimsqltext2AsString="selectsexfrom[User]whereid='"+ID+"'"

Try

()

Dimsqlcom1AsSqlCommand=NewSqlCommand(sqltext1,conn)

Dimsqlcom2AsSqlCommand=NewSqlCommand(sqltext2,conn)

=().ToString()

=().ToString()

()

If=Then

()

EndIf

CatchexAsException

EndTry

Else:

("")

EndIf

EndSub

ProtectedSubButton2_Click(senderAsObject,eAsEventArgs)Handles

DimidAsString=Session("login_name")

DimopwdAsString=DimconnAsNewSqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;")

DimsqltextAsString="select*from[User]whereid='"+id+"'andpwd='"+opwd+"'"

()

DimsqlcomAsSqlCommand=NewSqlCommand(sqltext,conn)

If()<>NothingThen

Dimn1AsString=

Dimn2AsString=

If(n1=n2)Then

Dimsqltext1AsString="update[User]setpwd='"+n1+"'whereid='"+id+"'"

Dimsqlcom1AsSqlCommand=NewSqlCommand(sqltext1,conn)

()

()

("")

Else:

("")

EndIf

Else:

("")

EndIf

If=Then

()

EndIf

EndSub

EndClass

4、首页页面

前端代码:

<%@PageLanguage="VB"AutoEventWireup="false"CodeFile=""Inherits="main"%>

DOCTYPEhtml>

房屋出租首页

类型:

DropDownListID="DropDownList1"runat="server">

ListItem>

ListItem>

ListItem>套房

ListItem>

ListItem>单间

ListItem>

DropDownList> 

所在街道:

TextBoxID="TextBox1"runat="server">

TextBox>

价格:

TextBoxID="TextBox2"runat="server"Width="60px">

TextBox>

TextBoxID="TextBox3"runat="server"Width="60px">

TextBox>



ButtonID="Button2"runat="server"Text=" 查询 ">

Button>



LabelID="Label1"runat="server"Text="Label">

Label>



ButtonID="Button1"runat="server"Text="个人中心">

Button>

后台代码:

ImportsClassmain

InheritsProtectedSubButton1_Click(senderAsObject,eAsEventArgs)Handles

If(Session("login_name")<>Nothing)Then

If(Session("login_name")="guest")Then

("")

Els

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 高中教育 > 初中教育

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2