欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    最新ASPNET课程设计.doc

    • 资源ID:33804932       资源大小:1.15MB        全文页数:29页
    • 资源格式: DOC        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    最新ASPNET课程设计.doc

    精品资料ASPNET课程设计.课程名称:ASP.NET课程设计姓名: 刘阳学号:201230330219所在专业:软件工程所在院系:信息工程学院辅导教师:宁星日期:2015年1月15日目录一、课程设计的目的·······························1二、课程设计要求·································1三、课题及内容···································1四、流程图·······································2五、数据库·······································2六、页面代码·····································3······3······················5················9···················13···················17····················19·················21 七、课程设计小结································23一、课程设计的目的 通过利用A进行web应用程序的设计与开发,加深对web程序开发的基本知识的理解,掌握动态页面设计的基本方法和步骤,掌握程序调试的一般方法和技巧。培养基本理论分析、解决实际问题的能力及锻炼写设计总结报告的能力。二、课程设计的基本要求 1. 本课程设计要求学生用A技术开发一个动态网站,利用B/S结构,能将客户端的用户请求提交给服务器端的程序处理。服务器端程序能完成数据的插入、删除、更新以及将用户请求的查询数据返回客户端。 2. 课程设计结束后,每位同学独立提交一份web课程设计报告,内容包括总体设计和算法分析,主要流程,测试数据及测试过程,遇到的问题及解决方法等 3. 界面截图里要有代表性的数据。三、课程设计的内容题目:基于Web的房屋出租信息发布系统 功能要求: 1. 用户管理功能,包括:用户注册,登录认证,修改个人信息; 2. 房屋出租信息发布:注册用户登录后可发布,查询,修改,删除自己发布的房屋出租信息; 3. 房屋信息查询:游客可按房屋类型,所处街道或出租价格查询相应的房屋出租信息。 4. 简易论坛或聊天室四、流程图登陆页面游客登陆用户登陆用户注册个人中心进入首页个人信息删除发布进入聊天室发布信息五、数据库SQL Server 中数据库里建立了三张表,分别是User表(用户信息表)、Fw表(房屋出租信息表)和chat表(聊天记录表)。1.User表中字段:id , pwd , name , sex2.Fw表中字段:id , 编号 , 类型 , 街道 ,价格3.chat表中字段:id , stext , stime六、页面代码1、登陆页面前端代码:<% Page Language="VB" AutoEventWireup="false" CodeFile="ulogin.aspx.vb" Inherits="_Default" %><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http:/www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <center> <h1>房屋出租系统</h1> <form id="form1" runat="server"> <asp:Label ID="Label1" runat="server" Text="用户名:"></asp:Label> <asp:TextBox ID="idtext" runat="server"></asp:TextBox><br/><br/> <asp:Label ID="Label2" runat="server" Text="密码:"></asp:Label> <asp:TextBox ID="pwdtext" runat="server" textmode="password"></asp:TextBox><br/><br/> <asp:Button ID="youke" runat="server" Text="游客" /> <asp:Button ID="login" runat="server" Text="登录" /><br/><br/> <asp:Button ID="uzc" runat="server" Text="注册" /> </form> </center></body></html>后台代码:Imports System.Data.SqlClientImports System.DataPartial Class _Default Inherits System.Web.UI.Page Protected Sub login_Click(sender As Object, e As EventArgs) Handles login.Click Dim id As String = idtext.Text.Trim() Dim pwd As String = pwdtext.Text.Trim() Dim conn As New SqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;") Dim sqltext As String = "select * from User where id = '" + id + "'and pwd ='" + pwd + "'" Try conn.Open() Dim sqlcom As SqlCommand = New SqlCommand(sqltext, conn) If sqlcom.ExecuteScalar() <> Nothing Then Session.Add("login_name", id) conn.Close() Response.Redirect("user.aspx") Else Response.Write("<script>alert('账号密码错误!')</script>") End If If conn.State = ConnectionState.Open Then conn.Close() End If Catch ex As Exception End Try End Sub Protected Sub uzc_Click(sender As Object, e As EventArgs) Handles uzc.Click Response.Redirect("uzc.aspx") End Sub Protected Sub youke_Click(sender As Object, e As EventArgs) Handles youke.Click Session.Add("login_name", "guest") Response.Redirect("main.aspx") End SubEnd Class2、 用户中心页面前端代码:<% Page Language="VB" AutoEventWireup="false" CodeFile="user.aspx.vb" Inherits="user" %><!DOCTYPE html><html xmlns="http:/www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title></head><body> <center> <form id="form1" runat="server"> <h2>用户中心</h2> <asp:Label ID="Label1" runat="server" Text="请重新登陆!" ForeColor="#0033CC"></asp:Label> <br /> <br /> <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> <br /> <br /> 根据编号:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button5" runat="server" Text="删除" style="height: 21px"></asp:Button> <br /> <br/> <asp:Button ID="Button2" runat="server" Text="首页"></asp:Button> <asp:Button ID="Button3" runat="server" Text="发布"></asp:Button><br/><br/> <asp:Button ID="Button1" runat="server" Text="个人信息"></asp:Button> <asp:Button ID="Button4" runat="server" Text=" 聊天室 "></asp:Button> <br /> </form> </center></body></html>后台代码:Imports System.Data.SqlClientImports System.DataPartial Class user Inherits System.Web.UI.Page Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If (Session("login_name") <> Nothing) Then Dim id As String = Session("login_name").ToString() Label1.Text = id + "欢迎您! 您的发布如下:" Dim conn As New SqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;") Dim sqltext As String = "select * from Fw where id = '" + id + "'" conn.Open() Dim sqlcmd As SqlCommand = New SqlCommand(sqltext, conn) Dim objectreader As SqlDataReader Dim i As Integer Dim fw As String objectreader = sqlcmd.ExecuteReader() fw = "<table border=2>" fw += "<tr>" For i = 0 To objectreader.FieldCount - 1 fw += "<td>" + objectreader.GetName(i) + "</td>" Next fw += "</tr>" While objectreader.Read() fw += "<tr>" For i = 0 To objectreader.FieldCount - 1 fw += "<td>" + CStr(objectreader.GetValue(i) + "</td>" Next fw += "</tr>" End While fw += "</table>" Label2.Text = fw conn.Close() Else : Response.Write("<script>alert('用户过期,请重新登陆!');window.location.href ='ulogin.aspx'</script>") End If End Sub Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Response.Redirect("userinfo.aspx") End Sub Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Response.Redirect("main.aspx") End Sub Protected Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click Response.Redirect("fatie.aspx") End Sub Protected Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Response.Redirect("chat.aspx") End Sub Protected Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click If (Session("login_name") <> Nothing) Then Dim id As String = Session("login_name") Dim n As String = TextBox1.Text.Trim() Dim conn As New SqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;") Dim sqltext As String = "DELETE FROM Fw WHERE id = '" + id + "'and 编号 = '" + n + "'" Try conn.Open() Dim sqlcom As SqlCommand = New SqlCommand(sqltext, conn) sqlcom.ExecuteNonQuery() conn.Close() Response.Write("<script>alert('删除成功!');window.location.href ='user.aspx'</script>") If conn.State = ConnectionState.Open Then conn.Close() End If Catch ex As Exception End Try End If End SubEnd Class3、 个人信息页面前端代码:<% Page Language="VB" AutoEventWireup="false" CodeFile="userinfo.aspx.vb" Inherits="userinfo" %><!DOCTYPE html><html xmlns="http:/www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title></head><body> <center> <form id="form1" runat="server"> <h2>您的个人信息</h2> <asp:Label ID="Label10" runat="server" Text="用户名:" ForeColor="#0033CC"></asp:Label> <asp:Label ID="Label11" runat="server" Text=" " ForeColor="#0033CC"></asp:Label> <asp:Label ID="Label6" runat="server" Text="姓名:" ForeColor="#0033CC"></asp:Label> <asp:Label ID="Label7" runat="server" Text=" " ForeColor="#0033CC"></asp:Label> <asp:Label ID="Label8" runat="server" Text="性别:" ForeColor="#0033CC"></asp:Label> <asp:Label ID="Label9" runat="server" Text=" " ForeColor="#0033CC"></asp:Label> <h2>信息完善与修改</h2> <asp:Label ID="Label1" runat="server" Text="姓名:"></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br/><br/> <asp:Label ID="Label2" runat="server" Text="性别:"></asp:Label> <asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem Value="男"></asp:ListItem> <asp:ListItem Value="女"></asp:ListItem> </asp:DropDownList><br/><br/> <asp:Button ID="Button1" runat="server" Text="更新" style="height: 21px"></asp:Button> <h2>修改密码</h2> <asp:Label ID="Label3" runat="server" Text="原密码:"></asp:Label> <asp:TextBox ID="oldpwd" runat="server" textmode="password"></asp:TextBox><br/><br/> <asp:Label ID="Label4" runat="server" Text="新密码:"></asp:Label> <asp:TextBox ID="newpwd1" runat="server" textmode="password"></asp:TextBox><br/><br/> <asp:Label ID="Label5" runat="server" Text="新密码:"></asp:Label> <asp:TextBox ID="newpwd2" runat="server" textmode="password"></asp:TextBox><br/><br/> <asp:Button ID="Button2" runat="server" Text="修改"></asp:Button> </form> </center></body></html>后台代码:Imports System.Data.SqlClientImports System.DataPartial Class userinfo Inherits System.Web.UI.Page Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If (Session("login_name") <> Nothing) Then Dim id As String = Session("login_name") Dim n As String = TextBox1.Text.Trim() Dim s As String = DropDownList1.Text Dim conn As New SqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;") Dim sqltext As String = "update User set name = '" + n + "',sex = '" + s + "'where id = '" + id + "'" Try conn.Open() Dim sqlcom As SqlCommand = New SqlCommand(sqltext, conn) sqlcom.ExecuteNonQuery() conn.Close() Response.Write("<script>alert('更新成功!');window.location.href ='user.aspx'</script>") If conn.State = ConnectionState.Open Then conn.Close() End If Catch ex As Exception End Try End If End Sub Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If (Session("login_name") <> Nothing) Then Dim id As String = Session("login_name") Label11.Text = id Dim conn As New SqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;") Dim sqltext1 As String = "select name from User where id = '" + ID + "'" Dim sqltext2 As String = "select sex from User where id = '" + ID + "'" Try conn.Open() Dim sqlcom1 As SqlCommand = New SqlCommand(sqltext1, conn) Dim sqlcom2 As SqlCommand = New SqlCommand(sqltext2, conn) Label7.Text = sqlcom1.ExecuteScalar().ToString() Label9.Text = sqlcom2.ExecuteScalar().ToString() conn.Close() If conn.State = ConnectionState.Open Then conn.Close() End If Catch ex As Exception End Try Else : Response.Write("<script>alert('用户过期,请重新登陆!');window.location.href ='ulogin.aspx'</script>") End If End Sub Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Dim id As String = Session("login_name") Dim opwd As String = oldpwd.Text.Trim() Dim conn As New SqlConnection("server=.;database=fwcz;uid=sa;pwd=91569;") Dim sqltext As String = "select * from User where id = '" + id + "'and pwd = '" + opwd + "'" conn.Open() Dim sqlcom As SqlCommand = New SqlCommand(sqltext, conn) If sqlcom.ExecuteScalar() <> Nothing Then Dim n1 As String = newpwd1.Text Dim n2 As String = newpwd2.Text If (n1 = n2) Then Dim sqltext1 As String = "update User set pwd = '" + n1 + "' where id = '" + id + "'" Dim sqlcom1 As SqlCommand = New SqlCommand(sqltext1, conn) sqlcom1.ExecuteNonQuery() conn.Close() Response.Write("<script>alert('修改成功,请重新登录!');window.location.href ='ulogin.aspx'</script>") Else : Response.Write("<script>alert('两次新密码输入不同!')</script>") End If Else : Response.Write("<script>alert('原密码输入错误!')</script>") End If If conn.State = ConnectionState.Open Then conn.Close() End If End SubEnd Class4、 首页页面前端代码:<% Page Language="VB" AutoEventWireup="false" CodeFile="main.aspx.vb" Inherits="main" %><!DOCTYPE html><html xmlns="http:/www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title></head><body> <center> <form id="form1" runat="server"> <h2>房屋出租首页</h2> 类型:<asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem></asp:ListItem> <asp:ListItem>套房</asp:ListItem> <asp:ListItem>单间</asp:ListItem> </asp:DropDownList> 所在街道:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 价格:<asp:TextBox ID="TextBox2" runat="server" Width="60px"></asp:TextBox> <asp:TextBox ID="TextBox3" runat="server" Width="60px"></asp:TextBox> <br /> <br /> <asp:Button ID="Button2" runat="server" Text="查询"></asp:Button> <br /> <br /> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <br /> <br/> <asp:Button ID="Button1" runat="server" Text="个人中心"></asp:Button>

    注意事项

    本文(最新ASPNET课程设计.doc)为本站会员(1595****071)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开