Demo/AddPrize.aspx.cs

(完整代码) 1KB

using Demo.Helper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Demo
{
    public partial class AddPrize : Page
    {
        private string LoginId = CookieHelper.GetCookie("Aid", "LoginId");

        protected void Page_Load(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(LoginId))
            {
                Response.Write("<script>alert('请您先登录再操作!');window.location.href='Login.aspx';</script>");
                Response.End();
            }
        }
        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            string name = TextUName.Text;
            string content = TextContent.Text;
            string Imgherf = TextHerf.Text;
            string Score = TextScore.Text;

            string sql = string.Format("insert into [Prize] values('{0}','{1}','{2}','{3}',0)", Imgherf, name, content, Score);
            int num1 = DBHelper.ExecuteNonQuery(sql);
            if (num1 > 0)
            {
                Response.Write("<script>alert('添加成功!')</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败!')</script>");
            }
        }
    }
}

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

AI 解读 AI

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

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