Manage/addnews.aspx.cs
(开头部分) 2KB这里只显示每个文件的开头 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.SqlClient;
using LYF.SqlHelper;
public partial class Manage_addnews : System.Web.UI.Page
{
private SqlHelper shp = new SqlHelper("XS");
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Uname"] == null || Session["Uname"].ToString() == "")
{
Response.Write("<script>parent.location.href='login.aspx'</script>");
}
if (!IsPostBack)
{
LoadBind();
}
}
private void LoadBind()
{
if (Request.QueryString["id"] != null)
{
string id = Request.QueryString["id"];
string sql = "select * from XS_News where id=" + id;
using (SqlDataReader dr = shp.ExecuteReader(sql))
{
if (dr.Read())
{
this.titleTB.Text = dr["title"].ToString();
this.msgTB.Text = dr["content"].ToString();
}
}
shp.CloseDB();
this.sumbitBT.Text = "编辑";
}
}
protected void sumbitBT_Click(object sender, EventArgs e)
{
if (this.sumbitBT.Text == "发布")
{
string insertsql = "insert into XS_News values('" + this.titleTB.Text + "','" + Server.UrlDecode(this.msgHF.Value) + "',getdate())";
shp.ExecuteNonQuery(insertsql);
ShowJsMsg("发布新闻成功!");
}
else if (this.sumbitBT.Text == "编辑")
{
string updatesql = "update XS_News set title='" + this.titleTB.Text + "',content='" + Server.UrlDecode(this.msgHF.Value) + "' where id=" + Request.QueryString["id"] + "";
shp.ExecuteNonQuery(updatesql);
ShowJsMsg("编辑新闻成功!");
}
}
后面还有 7 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。