index.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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.Data.OleDb;



public partial class index : System.Web.UI.Page
{
    OleDbConnection con;
    protected void Page_Load(object sender, EventArgs e)
    {
        string str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("DB_51Aspx/db.mdb");
        con = new OleDbConnection(str);
        try
        {
            con.Open();
            this.GridView1.Attributes.Add("bordercolor", "#79B7CF");
            on_user_nb.Text = Application["count"].ToString();

            if (!IsPostBack)
            {
                bind();
            }
        }
        catch
        {
            Response.Write("<script>alert('链接数据库失败!')</script>");
        }

        

    }
    public void bind()
    {
        string str = "select * from [leave_word] where [typeid]=0";
        string typeid = Request.QueryString["type"];
        title_name.Text = "搞笑幽默";
        string[] typeNames = { "搞笑幽默", "网络流行小说", "生活时尚", "鬼怪离奇" };

        if (typeid != "" && typeid != string.Empty && typeid != null)
        {
            str = "select * from [leave_word] where [typeid]=" + typeid;
            title_name.Text = typeNames[Int32.Parse(typeid)];
        }
        str += " order by [top] asc,[jh] asc ,[id] desc";
        OleDbDataAdapter da = new OleDbDataAdapter(str, con);
        DataSet ds = new DataSet();
        da.Fill(ds);
        GridView1.DataSource = ds.Tables[0];
        GridView1.DataBind();

        string SqlStr = "select count(*) from [leave_word]";
后面还有 55 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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