NewBBS.aspx.cs

(完整代码) 1KB

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;

public partial class NewBBS : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
   
        if (!IsPostBack)
        {
            if (Session["username"] == null)
            {
                Response.Write("<script>alert('没有登录,不能进行该操作');history.go(-1);</script>");
            }
           
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sql;

        if (Session["username"] == null)
        {
            Response.Write("<script>alert('没有登录,不能进行该操作');history.go(-1);</script>");
        }
        else if (this.WebEditor1.Text == "")
        {
            Response.Write("<script>alert('回复内容不能为空');</script>");
        }
        else
        {

            sql = "insert into 留言交流(标题,发帖人,内容) values('" + this.TextBox1.Text + "','" + Session["username"].ToString() + "','" + Class1.repString(this.WebEditor1.Text) + "')";
            
            int result;
            result = new Class1().hsgexucute(sql);
            if (result == 1)
            {
                Response.Write("<script>javascript:alert('操作成功');</script>");
            }
            else
            {
                Response.Write("<script>javascript:alert('系统错误,您没有设置好数据库的连接!');</script>");
            }
        }
    }
}

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

AI 解读 AI

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

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