本论文所研究的是如何建设一个符合客户要求的企业网站后台数据库管理系统-毕业设计内容摘要:

t source, ServerValidateEventArgs args)//判断用户名是否有重名 { string ArchName = ()。 if ((select count(*) from userinfo where [username]=39。 + ArchName + 39。 )) = false。 else = true。 } } 管理中心 登录界面( ) 功能简介 后台管理主要包括:用户注册页面,用户登录页面,添加新闻页面,添加分类页面,编辑新闻页面,编辑分类页面。 当首次进入后台管理,则会进入登录页面。 相关代码 %@ Page Language=C AutoEventWireup=true Inherits= CodeFile= % !DOCTYPE html PUBLIC //W3C//DTD XHTML Transitional//EN html xmlns= head runat=server title登录系统 /title /head body onload=(39。 txtUserName39。 ).focus() style=textalign: center form id=form1 runat=server defaultbutton=lbtnOK asp:Panel ID=Panel1 runat=server BackImageUrl=../images/ Height=500px Width=600px br / br / br / br / br / br / br / br / br / br / br / br / br / br / br / br / br / table tr td table cellpadding=5 cellspacing=1 width=360 tr td align=right width=100 style=height: 32px 用户名: /td td align=left style=height: 32px asp:TextBox ID=txtUserName runat=server CssClass=LoginUserName Width=200px/asp:TextBox/td /tr tr td align=right width=100 密 码: /td td align=left asp:TextBox ID=txtPassword runat=server CssClass=LoginPassword TextMode=Password Width=200px/asp:TextBox/td /tr /table /td td asp:ImageButton ID=lbtnOK runat=server ImageUrl=../images/ Width=50px OnClick=lbtnOK_Click //td /tr /table /asp:Panel /form /body /html 添加新闻 功能简介 新闻发布主要是定期的 介绍最近的动态、发展状况、新闻、人才招聘,让公司内部员工及时了解公司运作,接收通知,增加办公效率。 相关代码 %@ Page Language=C MasterPageFile=~/Admin/ AutoEventWireup=true CodeFile= Inherits=Admin_AddNews Title=添加新闻 % %@ Register Assembly= Namespace= TagPrefix=FCKeditorV2 % asp:Content ID=Content1 ContentPlaceHolderID=ContentPlaceHolder1 Runat=Server table border=1 cellpadding=0 cellspacing=0 style=width: 100%。 align=center tr style=fontsize: 12pt td colspan=2 style=height: 20px。 textalign: center strongspan style=fontsize: 14pt 发 布 文 章/span/strong/td /tr tr style=fontsize: 12pt td style=width: 70px。 height: 20px。 textalign: left span style=fontsize: 10pt 文章标题: /span/td td style=height: 20px。 textalign: left asp:TextBox ID=txtTitle runat=server/asp:TextBox asp:RequiredFieldValidator ID=RequiredFieldValidator1 runat=server ControlToValidate=txtTitle ErrorMessage=*/asp:RequiredFieldValidator/td /tr tr style=fontsize: 12pt。 color: 000000 td style=width: 70px。 height: 300px。 textalign: left span style=fontsize: 10pt 文章内容: /spanbr / asp:RequiredFieldValidator ID=RequiredFieldValidator2 runat=server ControlToValidate=FCKeditor1 ErrorMessage=*/asp:RequiredFieldValidator/td td style=textalign: left。 height: 300px。 fckeditorv2:fckeditor id=FCKeditor1 runat=server defaultlanguage=zh height=300px width=660px BasePath=../fckeditor//fckeditorv2:fckeditor /td /tr tr style=fontsize: 12pt td colspan=2 style=height: 25px。 textalign: center asp:Button ID=Button1 runat=server OnClick=Button1_Click Text=发 表 / asp:Button ID=Button2 runat=server OnClick=Button2_Click Text=重 写 //td /tr /table /asp:Content 第五章 具体实施 ASP 与 ACCESS 结合 连接文件 . 与 access 数据连接写在公共类库中,身份认证写在配置文件中,便于管理而且安全性高。 由于数据比较小故选择了 access 数据库,连接数据库存直接写在公共类 DB_Con 中。 creatCon:连接数据库类; public static OleDbConnection creatCon() { OleDbConnection db = new OleDbConnection(Provider=。 Data Source= + (~/App_Data/))。 return db。 } 全网站对数据操作分为:读、写,公共类库中根据网站读写数据的内容选择操作数据库存并返回数据的语句; public static DataView getRows(string sqlStr, string sqltable) //执行 SQL语句并返回表中的所有数据 public static DataRowView getEditRows(string sqlStr, string sqltable) //执行 SQL语句并返回表中的一行 public static object execSca1(string sqlStr) //返回第一行第一列 public static bool execSql(string sqlStr) //执行数据表的添加、删除和更新操作 从数据库读取信息 前台页面主要是读取数据库中的数据 主页读取新闻直接调用公共类库 DB_Con中的 getRows类读取新闻; DataView ds = (select top 8 Art_id,[title],[dtime] from tb_Article order by Art_id Desc, tb_Article)。 = ds。 = ps。 = Art_id。 ()。 读取一条用户数据信息 判断用户是否存在,采用 .内至验证控件 CustomValidator1进行验证, (select count(*) from userinfo where [username]=39。 + ArchName + 39。 ) 读取数据库中匹配的一条记录,进行对比。 写入用户注册信息 string regsql = insert into userinfo ([username],[password],sex,,speciality,taste) values (39。 + () + 39。 ,39。 + () + 39。 ,39。 + + 39。 ,39。 + () + 39。 ,39。 + () + 39。 ,39。 + () + 39。 )。 if ((regsql)) ()。 else ()。 页面编写插入的 sql语句调用公共类库中的, (regsql)执行插入请求。 信息写入数据库 后台页面执行数据的读、写操作 新闻新闻( ): 编写插入的。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。