ASP.NET个人博客网站的设计与实现(11)

来源:xiaoniu168.com 作者:本站原创 添加时间:2012-01-03 点击数:26565

计算机毕业设计我的博客功能介绍:

5.7 我的博客管理
本模块是会员发布日志信息,评论日志信息的功能。

以下是引用片段:

相关代码如下:
     string Key = GridView1.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString();
        if(e.CommandName == "Mod")
        {
            //跳转页面
            Response.Redirect("RzEdit.aspx?ID=" + Key);
        }
        else if(e.CommandName == "Del")
        {
            string DPath;
            if(Server.MapPath("").Substring(Server.MapPath("").Length - 1, 1) == @"\")
            {
                DPath = Server.MapPath("");
            }
            else
            {
                DPath = Server.MapPath("") + @"\";
            }

            DPath = DPath + @"Pic\";
            string PicName = tmpData.Get_Table("select 图片 from 日志 where  编号=" + Key + "").Rows[0][0].ToString();

            //删除关联的图片文件
            if(File.Exists(DPath + PicName))
                File.Delete(DPath + PicName);

            //删除评论信息
            tmpData.ExecSql("delete from 评论 where 博客编号=" + Key + " ");
            tmpData.ExecSql("delete from 日志 where 编号=" + Key + "");
            GridView1.DataSource = tmpData.Get_Table("select * from 日志 where 帐号='" + Session["USERID"].ToString() + "'");
            GridView1.DataBind();
        }
        else if(e.CommandName == "See")
        {
            Response.Write("('RzSee.aspx?tkid=" + Key + "');");
        }


<责任编辑:计算机毕业设计网(http://www.xiaoniu168.com)>

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网