• 大小: 1.45MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-29
  • 语言: C#
  • 标签: 贴吧  C#  

资源简介

仿照百度的贴吧,采用C#写的源码程序。数据库采用SQL SERVER2005

资源截图

代码片段和文件信息

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;


public partial class admin : System.Web.UI.Page
{
    string gvuniqueID = string.Empty;
    //int gvPageindex = 0;
    //int gvEditindex = -1;
    protected void Page_Load(object sender EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session[“username“] != null && Session[“usertype“].ToString() == “1“)
            {
                pagelist();
            }
            else
            {
                Response.Redirect(“Userlogin.aspx“);
            }
        }
    }
    
    private void pagelist()
    {
        DataSet ds = new DataSet();
        ds = sqlstore.seluserAriticle();
        GridView1.DataSource = ds;
        GridView1.DataBind();
        
    }
    public string showtype(object a)
    {
        string type = a.ToString();
        if (type == “0“)
        {
            type = “精品“;
        }
        else
        {
            type = “取消精品“;
        }
        return type;
    }
    public string showtop(object a)
    {
        string type = a.ToString();
        if (type == “0“)
        {
            type = “置顶“;
        }
        else
        {
            type = “取消置顶“;
        }
        return type;
    }
    protected void GridView1_OnRowCommand(object sender GridViewCommandEventArgs e)
    {
        int id =int.Parse(e.CommandArgument.ToString());
        string cmd = e.CommandName.ToString();
        switch (cmd)
        {
            case “type“:
                string atype = sqlstore.seltype(id);
                sqlstore.settype(atype id);
                break;
            case “top“:
                string atop = sqlstore.seltop(id);
                sqlstore.settop(atop id);
                break;
            //case “del“:
                //sqlstore.delAriticle(id);
                //break;
        }
        pagelist();
    }
    protected void GridView1_RowDeleting(object sender GridViewDeleteEventArgs e)//删除贴子信息
    {
        int id = int.Parse(((Label)GridView1.Rows[e.RowIndex].FindControl(“TextXu“)).Text);
        string recall = ((Label)GridView1.Rows[e.RowIndex].FindControl(“TextBox2“)).Text;
        string imgurl = ((Label)GridView1.Rows[e.RowIndex].FindControl(“Label1“)).Text;
        if (recall != “0“)
        {
            Response.Write(“ript>alert(‘此贴包含回复贴,不能删除!‘);location.href(‘admin.aspx‘)ript>“);
           
        }
        else
        {
            if (imgurl == null || imgurl == ““)
            {
                sqlstore.delAriticle(id);
            }
            else
            {                               
                string path = Server.MapPath(“cutimg“) + “/“ + imgurl.Sub

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        124  2009-08-13 04:53  www.codejia.com\com 36元,cn 3元.url

     文件        117  2008-08-05 13:58  www.codejia.com\买空间,免费建站.url

     文件       3524  2009-08-20 22:02  www.codejia.com\使用说明.txt

    .......       237  2007-12-26 14:59  www.codejia.com\模仿百度贴吧程序\1.txt

    .......      5080  2007-11-14 18:44  www.codejia.com\模仿百度贴吧程序\admin\admin_addadmin.aspx

    .......      1139  2007-11-14 18:44  www.codejia.com\模仿百度贴吧程序\admin\admin_addadmin.aspx.cs

    .......      1300  2007-11-14 11:48  www.codejia.com\模仿百度贴吧程序\admin\admin_default.aspx

    .......       420  2007-11-13 13:26  www.codejia.com\模仿百度贴吧程序\admin\admin_default.aspx.cs

    .......      1703  2007-11-16 12:52  www.codejia.com\模仿百度贴吧程序\admin\admin_infor.aspx

    .......      1424  2007-11-16 12:49  www.codejia.com\模仿百度贴吧程序\admin\admin_infor.aspx.cs

    .......      4585  2007-11-13 13:18  www.codejia.com\模仿百度贴吧程序\admin\admin_login.aspx

    .......       988  2007-11-13 13:32  www.codejia.com\模仿百度贴吧程序\admin\admin_login.aspx.cs

    .......      5018  2007-11-14 17:52  www.codejia.com\模仿百度贴吧程序\admin\admin_user.aspx

    .......      4108  2007-11-14 18:00  www.codejia.com\模仿百度贴吧程序\admin\admin_user.aspx.cs

    .......      1835  2007-11-19 11:35  www.codejia.com\模仿百度贴吧程序\admin\admin_userphoto.aspx

    .......      2536  2007-11-19 11:40  www.codejia.com\模仿百度贴吧程序\admin\admin_userphoto.aspx.cs

    .......     68925  2006-07-07 13:15  www.codejia.com\模仿百度贴吧程序\admin\img\bg.gif

    .......      3178  2007-11-19 12:29  www.codejia.com\模仿百度贴吧程序\admin\left.aspx

    .......       411  2007-11-13 13:42  www.codejia.com\模仿百度贴吧程序\admin\left.aspx.cs

    .......       447  2007-11-13 16:50  www.codejia.com\模仿百度贴吧程序\admin\logout.aspx

    .......       537  2007-11-14 19:00  www.codejia.com\模仿百度贴吧程序\admin\logout.aspx.cs

    .......       443  2007-11-13 13:43  www.codejia.com\模仿百度贴吧程序\admin\main.aspx

    .......       411  2007-11-13 13:43  www.codejia.com\模仿百度贴吧程序\admin\main.aspx.cs

    .......     10512  2007-11-09 17:47  www.codejia.com\模仿百度贴吧程序\admin.aspx

    .......      7851  2007-11-14 18:40  www.codejia.com\模仿百度贴吧程序\admin.aspx.cs

    .......      3032  2007-10-30 12:52  www.codejia.com\模仿百度贴吧程序\App_Code\ImageThumbnail.cs

    .......      1352  2007-11-12 18:37  www.codejia.com\模仿百度贴吧程序\App_Code\Md5Pw.cs

    .......     30797  2007-11-19 12:13  www.codejia.com\模仿百度贴吧程序\App_Code\sqlstore.cs

    .......   1179648  2007-12-26 15:00  www.codejia.com\模仿百度贴吧程序\App_Data\xytieba_Data.MDF

    .......   3538944  2007-12-26 15:00  www.codejia.com\模仿百度贴吧程序\App_Data\xytieba_Log.LDF

............此处省略736个文件信息

评论

共有 条评论