VB.NET博客系统(10)

来源:xiaoniu168.com 作者:本站原创 添加时间:2011-11-27 点击数:27782

计算机毕业设计博客空间管理功能介绍:

5.6 博客空间管理
本模块主要的功能:对于博客空间论坛的日常管理,会员有发布和回复各个主题内容的权限,管理员具备全部的权限,对于论坛的日常维护尤为重要。

以下是引用片段:

相关代码如下:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码
        If Not Page.IsPostBack Then
            Dim tmpCnn As New DataControl
            Me.dg.DataSource = tmpCnn.Get_Table("select * from 博客空间 order by 发布时间 DESC")
            Me.dg.DataBind()
        End If
        '根据不同的人员屏蔽相应 的使用权限
        If Session("UserID") Is Nothing Or Session("UserID") <> "admin" Then
            Me.dg.Columns(5).Visible = False
        End If
        If Session("UserID") Is Nothing Then
            Me.LinkButton2.Visible = False
        End If
        If Request.QueryString("Flag") <> "All" Then
            Me.Linkbutton1.Visible = True

        Else
            Me.Linkbutton1.Visible = False
        End If
    End Sub

    Private Sub dg_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg.ItemCommand
        If e.CommandName = "See" Then
            '查看当前的主题 跳转页面
            Response.=" & e.Item.Cells(0).Text)
        ElseIf e.CommandName = "Delete" Then
            '删除当前的主题 以及相关联的回复列表
            Dim tmpCnn As New DataControl
            tmpCnn.ExecSql("delete from 空间回复 where 主题编号=" & e.Item.Cells(0).Text)
            tmpCnn.ExecSql("delete from 博客空间 where 主题编号=" & e.Item.Cells(0).Text)
            Me.dg.DataSource = tmpCnn.Get_Table("select * from 博客空间 order by 发布时间 DESC")
            Me.dg.DataBind()
        End If
    End Sub

〖资料来源:计算机毕业论文 www.xiaoniu168.com

第11页为计算机毕业论文文件管理功能介绍......

【联系方式】

【本站信誉】

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