Admin/EditVideo.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;
public partial class Admin_EditVideo : System.Web.UI.Page
{
    SqlHelper data = new SqlHelper();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            Get_Article();
        }
    }

    private void Get_Article()
    {
        int id = int.Parse(Request.QueryString["id"].ToString());
        SqlDataReader dr = data.GetDataReader("select * from Video where id=" + id);
        dr.Read();
        TextBox1.Text = dr["VideoName"].ToString();
        ArticleContent.Value = dr["VideoDs"].ToString();
        pic.Text = dr["VideoPath"].ToString();
        TextBox2.Text = dr["Photo"].ToString();
        this.Image1.ImageUrl = "../files/" + dr["Photo"].ToString();
    }


    protected void Button1_Click(object sender, EventArgs e)
    {
        string res;
        upload up = new upload();
        res = up.Up(file1, "../files/");

        this.Label1.Visible = true;
        this.Label1.Text = up.Resup[Convert.ToInt32(res)];
        this.pic.Text = up.s;
        Hidden1.Value = up.fname;
    }
    protected void Button1_Click1(object sender, EventArgs e)
    {
        string filename = Hidden1.Value;
        int i = this.pic.Text.LastIndexOf(".");
        string newname = this.pic.Text.Substring(i);//获取文件的扩展名
        int id = int.Parse(Request.QueryString["id"].ToString());
        data.RunSql("update Video set Photo='"+TextBox2.Text+"' , VideoName='" + TextBox1.Text + "',VideoDs='" + ArticleContent.Value + "',VideoPath='" + pic.Text + "' ,Ename='" + newname + "',FileName='" + TextBox1.Text + "' where id=" + id);
        Alert.AlertAndRedirect("修改成功!", "VideoManger.aspx");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        string res;
        upload up = new upload();
后面还有 8 行代码,购买后查看完整代码

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

AI 解读 AI

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

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