AddZJ.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AddZJ : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            if (Session["studentid"] == null)
            {
                Response.Redirect("UserLogin.aspx");
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string mingcheng = this.username.Value;
        //将相关的图片上传到@"uppic\"路径下
        string FileName = HiddenFieldPic.Value;
       
       
        string id = Session["studentid"].ToString();
        sqlConn conn = new sqlConn();
        string strsql = "insert into zhengjianzhao(xueshengID,mingcheng,tupian)values(";
        strsql += "" + Session["studentid"].ToString() + ",'" + mingcheng + "', '" + FileName + "')";
        conn.hsgexucute(strsql);
        Response.Write("<script language=javascript>alert('上传成功!');location='UserZJ.aspx'</script>");
    }
}

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

AI 解读 AI

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

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