Post.aspx.cs

(开头部分) 1KB

这里只显示每个文件的开头 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;

public partial class Post : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
 
        }
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        string userName = this.TextBox1.Text;
        string Sex = null;
        string imageAddress = null;
        if (this.RadioButton1.Checked == true)
        {
            Sex = "男";
            imageAddress = "boy.gif";
        }
        else
        {
            Sex = "女";
            imageAddress = "girl.gif";
        }
        string QQ = this.TextBox2.Text;
        string Email = this.TextBox3.Text;
        string Content = this.TextBox4.Text;

        SqlConnection conn = DB.getConnection();
        SqlCommand cmd = new SqlCommand("insert into guestInfo(userName,Sex,QQ,Email,Content,ImageAddress) values('" + userName + "','" + Sex + "','" + QQ + "','" + Email + "','" + Content + "','" + imageAddress + "')", conn);
        conn.Open();
        int count = cmd.ExecuteNonQuery();
        conn.Close();
        if (count > 0)
        {
            Response.Redirect("ShowInfo.aspx?info=" + Server.UrlDecode("发布成功!!!") + "");
        }
        else
        {
            Response.Redirect("ShowInfo.aspx?info=" + Server.UrlDecode("发布失败!!!") + "");
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        this.TextBox1.Text = "";
        this.RadioButton1.Checked = true;
        this.TextBox2.Text = "";
后面还有 5 行代码,解锁后查看完整代码

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

AI 解读

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

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