more.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;
using System.Xml;

public partial class more : System.Web.UI.Page
{
    int lowhouseid;  //定义接受参数的名称 必须和传递参数页面的名称一样
    protected void Page_Load(object sender, EventArgs e)   
    {
        if (Request.Params["lowhouseid"] != "")             //判断接受到的参数是否为空
        {
            lowhouseid = Convert.ToInt32(Request.Params["lowhouseid"]);  //将接受到的参数转换成32位并赋值给 lowhouseid
        }
        if (!Page.IsPostBack)    //网页改为PostBack回发方式
        {
            mores(lowhouseid);   //载入私有方法
        }
    }
    private void mores(int lowhouseid)
    {
        SqlConnection conn = new SqlConnection(access.sqlconn);
        conn.Open();
        string strcmd = "select * from info where infoid=" + lowhouseid;
        SqlCommand comm = new SqlCommand(strcmd, conn);
        SqlDataReader dr = comm.ExecuteReader(CommandBehavior.CloseConnection);
        if (dr.Read())
        {
            Label1.Text = dr["infoid"].ToString();
            Label2.Text = dr["month"].ToString();
            Label3.Text = dr["category"].ToString();
            Label4.Text = dr["mode"].ToString();
            Label5.Text = dr["power"].ToString();
            Label6.Text = dr["price"].ToString();
            Label7.Text = dr["bargain"].ToString();
            Label8.Text = dr["letter"].ToString();
            Label9.Text = dr["username"].ToString();
            Label10.Text = dr["userid"].ToString();
            Label11.Text = dr["time"].ToString();
        }
    }
}

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

AI 解读 AI

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

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