




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
...wd......wd......wd...新闻发布系统--总结报告工程:HTML5与ASP.NET程序设计教程组长:XXX成员:XXXXXX
XX1.工程简介新闻发布系统是一个可在线登录和评论的新闻系统。管理员可以发布时事新闻,用户可以一游客和会员的身份进入网站浏览和检索新闻。2.成员分工总体规划控制:xxx主模版设计:xxx用户登录设计:xx分类新闻界面设计:xx新闻内容设计:xx新闻评论设计:xx新闻信息管理设计:xx数据库设计:xx3.功能介绍本系统主要实现了用户登录、新闻检索、查看新闻详细内容、发布修改新闻和评论新闻等功能。3.1用户登录此功能需要用户按要求注册会员信息〔图3.1.1〕,系统管理员通过核实,同意用户申请之后用户就可以登录系统进展其他操作。图3.1.1图新闻检索本系统中,用户可以通过首页的搜索框搜索自己需要的新闻〔图3.2.1〕。图查看新闻内容用户可以选择自己关注的新闻,点击链接即可查看自己所需要新闻的详细信息。(图3.3.1和图3.3.2)图3.3.1图评论新闻〔仅限于会员〕用户可在查看新闻之后,在评论区发表自己的观点,发表自己的见解。〔图3.4.1〕图发布新闻〔仅限于管理员〕管理员需要对新闻先进展审核,判断下新闻的价值,以及合法性,只有通过管理员审核,才可以进展发布。同时,需要给新闻进展分类,标注下与新闻相关的信息。〔图3.5.1和图3.5.2〕图3.5.1图3.5.24.开发过程4.1数据库设计我们这个新闻发布系统的后台用的是SQL做的数据库。主要功能:存储新闻,存储评论,并且该数据库可更新。1.UserTable存储用户的账号,密码信息。2.NewsTable用来存储和新闻相关的信息,标题,作者,时间等。3.CommentTable用来存储评论的内容,并可更新。4.2用户登录模块设计本模块主要以用户注册信息并通过后台程序添加到数据库为根基,用户在登录页面输入用户信息,系统后台验证后获取登录状态。1.注册网页代码〔运行结果如图3.1.1〕:<divclass="conMain"><divclass="loginHeader">注册用户信息</div><divclass="loginForm"><divclass="loginBox"><divclass="regText"><divclass="labelDiv">用户名:</div><asp:TextBoxID="uText"class="userText"runat="server"></asp:TextBox><%--<inputtype="text"id="userText">--%></div><divclass="regText"><divclass="labelDiv">密码:</div><asp:TextBoxID="pText1"class="passText1"type="password"runat="server"></asp:TextBox><%--<inputtype="password"id="passText1">--%></div><divclass="regText"><divclass="labelDiv">再次输入密码:</div><asp:TextBoxID="pText2"class="passText2"type="password"runat="server"></asp:TextBox><%--<inputtype="password"id="passText2">--%></div><divclass="regBtn"><asp:ButtonID="sBtn"class="submitButn"runat="server"Text="注册"onclick="sBtn_Click"/><%--<inputtype="submit"value="注册"id="submitButn">--%></div></div></div>2.登录页面代码〔运行结果如图3.1.2〕:<!--内容主体!--><divclass="conMain"><divclass="loginHeader">用户登录</div><divclass="loginForm"><divclass="lloginForm"><imgsrc="../pic/logo-1.gif"alt="新闻图片"/></div><divclass="rloginForm"><div><divclass="loginBox"><divclass="regText"><inputtype="text"id="uText"class="userText"runat="server"></div><divclass="regText"><inputtype="password"id="pText"class="passText"runat="server"></div><divclass="regBtn"><asp:ButtonID="sBtn"class="submitButn"runat="server"Text="登录"onclick="sBtn_Click"/><%--<inputtype="submit"value="登录"id="submitButn"onclick="returnsubmitButn_onclick()">--%></div><divclass="regInfo"><spanclass="noId">没有帐号,<ahref="register1.aspx"target="_self"class="toReg">立即注册</a></span></div></div></div>4.3主页显示模块设计本模块使用母版页设计,通过显示新闻类别和热点新闻,为用户浏览新闻做导航。1.母版页设计代码:<%@MasterLanguage="C#"AutoEventWireup="true"CodeBehind="Site1.master.cs"Inherits="NewsASP.Site1"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"":///TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns=":///1999/xhtml"><headrunat="server"><title></title><asp:ContentPlaceHolderID="head"runat="server"></asp:ContentPlaceHolder><linkhref="CSS/Nav.css"rel="stylesheet"type="text/css"/></head><body><formid="form1"runat="server"><div><!--导航--><divclass="nav"style="margin:0auto;"><ul><li><ahref="NEWS.aspx"class="selected"target="_blank"><imgsrc="../pic/树叶/首页.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="NEWS.aspx"class="selected"target="_blank"><imgsrc="../pic/树叶/国际.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="NEWS.aspx"class="selected"target="_blank"><imgsrc="../pic/树叶/国内.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="NEWS.aspx"class="selected"target="_blank"><imgsrc="../pic/树叶/社会.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="NEWS.aspx"class="selected"target="_blank"><imgsrc="../pic/树叶/图片.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="NEWS.aspx"class="selected"target="_blank"><imgsrc="../pic/树叶/视频.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="NEWS.aspx"class="selected"target="_blank"><imgsrc="../pic/树叶/娱乐.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="NEWS.aspx"class="selected"target="_blank"><imgsrc="../pic/树叶/小说.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="InnerNews.htm"class="selected"target="_blank"><imgsrc="../pic/树叶/汽车.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="SportNews/Sport1.aspx"class="selected"target="_blank"><imgsrc="../pic/树叶/体育.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="InnerNews.htm"class="selected"target="_blank"><imgsrc="../pic/树叶/游戏.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="InnerNews.htm"class="selected"target="_blank"><imgsrc="../pic/树叶/科技.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li><li><ahref="InnerNews.htm"class="selected"target="_blank"><imgsrc="../pic/树叶/军事.png"alt=""style="margin-top:-20px;height:65px;width:70px"/></a></li></ul><</form></body></html>母版页运行结果2.主页显示局部代码〔运行结果如3.2.1〕:<linkhref="CSS/Nav.css"rel="stylesheet"type="text/css"/></asp:Content><asp:ContentID="Content2"ContentPlaceHolderID="ContentPlaceHolder1"runat="server"><divclass="main"style="border-width:1px;border-color:#005AB5;"><!--搜索-登录-注册--><%--<imgsrc="../pic/背景/左上角.gif"alt=""style="position:absolute;margin-left:-250px;margin-top:-100px;"/>--%><div><divclass="search"><pstyle="color:Purple;font-size:300%;font-family:@幼圆"><i><b>News新闻</b></i><textareacols=""rows="1"style="overflow:hidden;resize:none;width:500px;height:40px;"></textarea><spanstyle="margin-bottom:-5px;margin-top:5px;"><buttonid="login"style="margin-bottom:-18px;margin-top:18px;height:35px;width:50px">搜索</button><ahref="asp/login1.aspx"target="_blank"style="font-size:medium">登录</a><ahref="asp/register1.aspx"target="_blank"style="font-size:medium">注册</a></span></p></div></div><!--热点新闻--><div><divclass="hot"style="float:left;width:600px;"><divclass="sign1"style="background-color:#DCDCDC;"><imgsrc="../pic/标签/热点.png"style="width:70px;height:65px;"alt=""/><br/></div><divclass="content"style="background-color:#E0FFFF;"><divid="contentHref"runat="server"style="margin-left:0px;margin-top:0px;"></div><divclass=""style="float:right;width:350px;"><h3><ahref="://news.baidu/n?cmd=1&class=reci"target="_blank">新闻热搜词</a> <ahref="://news.baidu/n?cmd=1&class=reci"target="_blank">更多>></a></h3><div><ulclass="hotwords"><li><pstyle="margin-top:28px;">博鳌论坛</p><aclass="cover"href="://news.baidu/ns?cl=3&ct=9&rn=20&sp=hotquery&word=2014%20%B2%A9%F7%A1"target="_blank"><strong>博鳌论坛</strong><br/></a></li><li><pstyle="margin-top:28px;">XP退休</p><aclass="cover"href="://news.baidu/ns?cl=3&ct=9&rn=20&sp=hotquery&word=%CE%A2%C8%ED%20XP%20%20%CD%A3%D6%B9"target="_blank"><strong>XP退休</strong><br/></a></li><li><pstyle="margin-top:28px;">车臣分裂头目被消灭</p><aclass="cover"href="://news.baidu/ns?cl=3&ct=9&rn=20&sp=hotquery&word=%CE%DA%C2%ED%C2%DE%B7%F2"target="_blank"><strong>车臣分裂头目被消灭</strong><br/></a></li>3.体育主页显示代码〔运行结果图3.2.2〕:<divclass="nav1-wrap"data-sudaclick="main_nav"><divclass="wrap"><ulclass="a"><liclass="current"><ahref="Sport1.aspx"target:"_black">首页</a></li><li><ahref="Sport1.aspx#a"target:"_black">世界杯</a></li><li><ahref="Sport1.aspx#a4"target:"_black">综合</a></li></ul></div></div></div><divclass="frame"><divclass="frame_L"><h3style="color:Red"><ahref="../newsContent.aspx?ID=11"target="_blank"><spanstyle="color:Red">足协裁定刘健自由身</span></a></div><divclass="frame_R"style="color:White"><imgalt="tupian"src="SportPic/1.jpg"style="height:300px;width:450px"/><h4style="margin-top:-35px;margin-bottom:-15px;">詹姆斯持球背身单打</h4><pstyle="font-size:15px;">近日,热火队员“小皇帝〞,在与芝加哥公牛的比赛中,单刀持球。</p><inputid="Button1"type="button"value="点赞+0"style="float:right"onclick="Button1_Click()"/></div></div>4.4新闻内容显示模块设计本模块主要是从各个链接中获取新闻ID,然后从数据库中读取新闻并显示。后台代码:namespaceNewsASP{publicpartialclassnewsContent:System.Web.UI.Page{intid;protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){id=int.Parse(Request.QueryString["ID"].ToString());DataClasses1DataContextc=newDataClasses1DataContext();//名为contentLeft的div中加contentvarcontent=fromtinc.newsTablewheret.nid==idselectt.ncontent;this.contentLeft.InnerHtml=content.First();//在contentTitle的div中加vartitle=fromtinc.newsTablewheret.nid==idselectt.title;this.contentHead.InnerHtml=title.First();//留言版添加内容stringleaveWord="";//stringcomUser="";varleaveCon=fromtincmentTablewheret.nid==idselectt;foreach(varvinleaveCon){leaveWord+="<p>评论者:"+v.uid+"\n"+""+v.ccontent+"\n</p>";}//stringstr=leaveWord.ToString();this.leave.InnerHtml=leaveWord.ToString();}}protectedvoidLinkButton1_Click(objectsender,EventArgse){Response.Redirect("asp/comment.aspx?ID="+id);}}运行界面如图.5评论新闻模块设计本模块主要是用户评论新闻,但是用户要在登录后才能评论:后台代码:publicpartialclasscomment:System.Web.UI.Page{intnid=0;protectedvoidPage_Load(objectsender,EventArgse){if(Session["name"]==null){Response.Redirect("login1.aspx");return;}else{//this.TextBox1.Text=Session["name"].ToString();stringstr=Request.QueryString["nid"].ToString();nid=int.Parse(str);DataClasses1DataContextdb=newDataClasses1DataContext();varq=fromtindb.newsTablewheret.nid==this.nidselectt;if(q.Count()==1){this.lTitle.Text=q.First().title.ToString();}}}protectedvoidtButton_Click(objectsender,EventArgse){stringuid=Session["name"].ToString();DataClasses1DataContextdb=newDataClasses1DataContext();intmax=dbmentTable.Count();commentTablet=newcommentTable();t.nid=this.nid;t.uid=uid;t.ccontent=this.tBox.Text;dbmentTable.InsertOnSubmit(t);db.SubmitChanges();Response.Redirect("login1.aspx");}}运行界面如图发布新闻模块设计本模块主要是对新闻信息的增加、删除和修改。后台代码:namespaceNewsASP.asp{publicpartialclassmanager:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(!this.IsPostBack){this.DropDownList1.Items.Clear();DataClasses1DataContextdb=newDataClasses1DataContext();varq=fromtaindb.newsTableselectta;if(q.Count()>0){foreach(vartinq){this.DropDownList1.Items.Add(t.nid.ToString());}}}}protectedvoidDropDownList1_SelectedIndexChanged(objectsender,EventArgse){intnid=int.Parse(this.DropDownList1.SelectedItem.Text);DataClasses1DataContextdb=newDataClasses1DataContext();varq=fromtaindb.newsTablewhereta.nid==nidselectta;if(q.Count()==
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 室外庭院涂料施工方案
- 机房 施工方案
- 开工施工方案
- 滩涂锚杆施工方案
- TSHJNXH 0014-2024 火力发电厂烟气二氧化碳捕集系统(化学吸收法)能效评价方法
- TSHAEPI 003-2022 餐饮油烟在线监测(光散射法)与监控技术规范
- 二零二五年度解除影视制作解除担保合同
- 二零二五年度个人债权转让及债务清收执行合作协议
- 二零二五年度跨境离婚协议书电子化执行合同
- 二零二五年度子女自愿离婚协议书范本及离婚后子女监护权
- 2024年实验小学大队委竞选笔试试题题库
- 普通工安全技术操作规程交底注意事项(8篇)
- 2025届江苏省十三大市高三冲刺模拟历史试卷含解析
- 《高等数学(第2版)》 高职 全套教学课件
- 五代十国史料辑存阅读笔记
- DataOps 实践指南 2.0白皮书
- 农村宅基地和建房(规划许可)申请表
- 2024年铁岭卫生职业学院单招职业技能测试题库及答案解析
- 课本剧哈姆雷特剧本
- 供电所班组建设方案
- 委托处置不良资产协议(三篇)
评论
0/150
提交评论