tieziList.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class tieziList : System.Web.UI.Page
{
    Alert js = new Alert();
    SqlHelper data = new SqlHelper();
    public string fenleiName = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            Get_Info();
        }
    }
    private void Get_Info()
    {
        string fenleiID = Request["fenleiID"].ToString();
        string strsql = "select * from fenlei where id=" + fenleiID + "";
        DataSet ds1 = new DataSet();
        ds1= data.GetDs(strsql, "ds");
        fenleiName = ds1.Tables[0].Rows[0]["fenleiName"].ToString();
        string sql = "select a.*,case when b.shuliang is null then 0 else b.shuliang end as shuliang, c.xingming   from dbo.Topic a left join(select TopicID,count(*) as shuliang from TopicRey group by TopicID) as b on a.ID=b.TopicID left join yonghu c on a.AddUser=c.yonghuhao where a.fenleiID=" + fenleiID + " ";
  
        DataSet ds2 = new DataSet();
        ds2 = data.GetDs(sql, "ds");
        Repeater1.DataSource = ds2.Tables[0];
        Repeater1.DataBind();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Session["yonghuhao"] == null)
        {
            Alert.AlertAndRedirect("发帖请先登陆!", "Default.aspx");
            return;
        }
        if (Request["fenleiID"] != null)
        {
            string fenleiID = Request["fenleiID"].ToString();
            Response.Redirect("AddTopic.aspx?fenleiID=" + fenleiID + "");
        }
        else 
        {
            Response.Redirect("AddTopic1.aspx");
        }
        
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。