BBS毕业论文(网络讨论平台)(8)

2019-08-29 23:18

四川理工学院本科毕业论文

参考文献

[1]李晶.网络论坛的发展及影响[J].新闻前哨,2010,9:34~37.

[2]王天意.网络舆论引导与和谐论坛建设[M].北京市:人民出版社,2008.

[3]杜广霞,石慧,王丽红.ASP.NET程序设计实训教程[M].北京市:清华大学出版社,2011. [4]马秀麟,李葆萍,张倩.动态网站设计与开发ASP.NET版[M].北京市:清华大学出版社,2012. [5]覃国蓉.基于B/S架构的软件项目实训[M].北京市:电子工业出版社,2004. [6]王珊,萨师烜.数据库系统概论[M].北京:高等教育出版,2009.

[7]虞益诚.SQL Server 2005数据库应用技术[M].北京市:中国铁道出版社,2009. [8]魏衍君,焦克莹.SQL Server 2005实用教程[M].西安市:西北工业大学出版社,2008. [9]Andrew M Fedorchek.SQL Server核心技术精解[M].北京:中国水利水电出版社,2000. [10]Steve Adrien Deluca.SQL Server性能优化[M].北京:机械工业出版社,2000. [11]汤海滨.SQL Server数据库开发技术[M].北京:科学出版社,2000.

[12]马传宝.SQL Server数据库项目案例导航[M].北京:清华大学出版社,2005. [13]王浩等.零基础学SQL Server 2005[M].北京:机械工业出版社,2010. [14]贾华丁.Web程序设计[M].北京:高等教育出版社,2005.

[15]Steven A Smith.用实例学Asp.net[M].北京:电子工业出版社,2002.

[16]Richard Anderson Chris Blexrud.Professional Active Server Page[M].北京机械工业,2010.

31

网络讨论平台的设计与实现

附 录

1、用户密码修改代码:

private void UPpwd()

{

SqlHelper mydata = new SqlHelper(); string Username = Session[\ try {

string sql = \[loginuser] set [Password] ='\+ txtpwd2.Text.ToString()+ \where [use_id]='\+ Username + \\ mydata.RunSql(sql);

LabelWarningMessage.Text = \修改成功!\ } catch {

LabelWarningMessage.Text = \修改失败!\ } }

///

/// 检验原来的密码 /// private void chkpwd() {

SqlDataReader dr;

dr = data.GetDataReader(\* from loginuser where use_id='\+ Session[\ d\+ \and Password='\+ txtpwd1.Text + \ if (dr.Read()) {

UPpwd(); } else {

LabelWarningMessage.Text = \原密码不正确!\ }

}

2、个人信息修改代码

public partial class ModifyMyInfo : System.Web.UI.Page {

SqlHelper data = new SqlHelper();

protected void Page_Load(object sender, EventArgs e) {

this.Title = \网络讨论平台\

32

四川理工学院本科毕业论文

if (!IsPostBack)

{

SqlHelper data = new SqlHelper(); string id = Session[\

SqlDataReader dr = data.GetDataReader(\* from loginuser where use _id=\+ id); dr.Read();

txtname.Text = dr[\ XingMing.Text = dr[\ Age.Text = dr[\ txtds.Text = dr[\ txtemal.Text = dr[\ QQ.Text = dr[\ pic.Text = dr[\

Image1.ImageUrl = \+ dr[\ } }

protected void LinkButton1_Click(object sender, EventArgs e) {

Response.Redirect(\

}

protected void LinkButton8_Click(object sender, EventArgs e) {

Response.Redirect(\ }

protected void LinkButton9_Click(object sender, EventArgs e) {

Response.Redirect(\

}

protected void Button1_Click(object sender, EventArgs e) {

string id = Session[\

data.RunSql(\ loginuser set name='\+ txtname.Text + \+ XingMing.Text + \+ Age.Text + \+ txtds.Text + \ ='\+ txtemal.Text + \+ QQ.Text + \+ pic.Text + \where use_id=\+ id);

Alert.AlertAndRedirect(\修改成功\\ }

protected void Button2_Click(object sender, EventArgs e) {

string res;

upload up = new upload();

33

网络讨论平台的设计与实现

res = up.Up(file1, \

this.Label1.Visible = true;

this.Label1.Text = up.Resup[Convert.ToInt32(res)]; this.pic.Text = up.s;

Image1.ImageUrl = \+ pic.Text; } }

3、资讯管理代码

public partial class Admin_NewsList : System.Web.UI.Page { SqlHelper data = new SqlHelper();

protected void Page_Load(object sender, EventArgs e) {

if (!IsPostBack) {

Get_Info(); } }

protected void gvInfo_RowDeleting(object sender, GridViewDeleteEventArgs e) {

SqlHelper mydata = new SqlHelper();

string ID = gvInfo.DataKeys[e.RowIndex].Values[0].ToString(); try

{

mydata.RunSql(\ from News where id='\+ ID + \ Label4.Text = \删除成功!\ gvInfo.EditIndex = -1; Get_Info(); } catch {

Label4.Text = \删除失败!\ }

}

private void Get_Info() {

try

{

gvInfo.DataSource = GetCodeBy(0); gvInfo.DataBind(); } catch { }

34

四川理工学院本科毕业论文

}

protected void gvInfo_PageIndexChanging(object sender, GridViewPageEventArgs e) {

gvInfo.PageIndex = e.NewPageIndex; Get_Info();

}

protected void gvInfo_RowDataBound(object sender, GridViewRowEventArgs e) {//鼠标移动变色

if (e.Row.RowType == DataControlRowType.DataRow)

{//当鼠标放上去的时候 先保存当前行的背景颜色 并给附一颜色

e.Row.Attributes.Add(\\ r;this.style.backgroundColor='#f6f6f6',this.style.fontWeight='';\

//当鼠标离开的时候 将背景颜色还原的以前的颜色

e.Row.Attributes.Add(\\ this.style.fontWeight='';\ }

//单击行改变行背景颜色

if (e.Row.RowType == DataControlRowType.DataRow) {

e.Row.Attributes.Add(\\this.sty le.color='buttontext';this.style.cursor='default';\ } }

public DataSet GetCodeBy(int iCount) {

SqlHelper date = new SqlHelper(); string strTop = \ if (iCount > 1) {

strTop = \\+ iCount.ToString(); }

string sql = \ \+ strTop + \ * from [News] \

SqlConnection con = new SqlConnection(SqlHelper.connstring); SqlCommand cmd = new SqlCommand(sql, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = null; try

{

con.Open(); ds = new DataSet(); da.Fill(ds); }

catch (SqlException ex) {

35


BBS毕业论文(网络讨论平台)(8).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:浅谈悬索结构论文

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: