houtai/reply.aspx.cs
(完整代码) 1KBusing 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;
namespace 电子商务.houtai
{
public partial class reply : System.Web.UI.Page
{
SQLHelper db = new SQLHelper();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int id = int.Parse(Request.QueryString["id"].ToString());
string sql = "select * from book where book_id=" + id;
DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
this.lb_content.Text = dt.Rows[0]["neirong"].ToString();
this.lb_userid.Text = dt.Rows[0]["username"].ToString();
}
}
//
protected void Button1_Click(object sender, EventArgs e)
{
int id = int.Parse(Request.QueryString["id"].ToString());
string reply = this.txt_reply.Text.ToString();
string sql = "update book set remark='" + reply + "' where book_id=" + id;
db.ExecuteNonQuery(sql, CommandType.Text);
Response.Write("<script>alert('回复成功!');location='booklist.aspx'</script>");
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。