admin/admin_menu_edit_image.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 admin_admin_menu_edit_image : System.Web.UI.Page
{
    protected string cname = "";
    protected string id = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Cookies["userName"] == null)
        {
            Response.Redirect("login.aspx");
        }

        string imageurlhtml = Request.QueryString["imageurlhtml"];
        cname = Request.QueryString["cname"];
        id = Request.QueryString["id"];
        string isPostback = Request.Form["isPostback"];
        string fid=Request.Form["fid"];
        if (!string.IsNullOrEmpty(isPostback))
        {
            if (Request.Files.Count > 0)
            {
                    string name = Request.Files[0].FileName;
                    string editstopath = "";
                    if (!String.IsNullOrEmpty(name))
                    {
                        string extension = System.IO.Path.GetExtension(name);
                        editstopath = "images/" + Guid.NewGuid().ToString() + extension;
                        string path = Server.MapPath("../" + editstopath);
                        Request.Files[0].SaveAs(path);
                    }
                    else {
                        editstopath = imageurlhtml;
                    }
                    Response.Redirect("admin_menu_edit.aspx?id=" + fid + "&editstopath=" + editstopath);
            }
        }
    }
}

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

AI 解读

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

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