Web/admin/editerpic.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;

namespace ClothesShop.Web.admin
{
    public partial class editerpic : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (user.IsLogin() == true && user.getUserRole() == 2)
            {
                if (!this.IsPostBack)
                {
                    this.Bind();
                }
            }
            else
            {
                this.Response.Redirect("logins.aspx");
            }
        }
        ClothesShop.BLL.userinfo user = new ClothesShop.BLL.userinfo();
        /// <summary>
        /// 绑定图片
        /// </summary>
        private void Bind()
        {
            this.pic.ImageUrl = "../pic/" + this.Request.QueryString["path"].ToString();
        }

        protected void uploadBt_Click(object sender, EventArgs e)
        {
            if (this.picupload.HasFile)
            {
                if (this.Request.QueryString["path"].ToString() != "nopic.gif")
                {
                    this.picupload.SaveAs(Server.MapPath("../pic/" + this.Request.QueryString["path"].ToString()));
                }
                else
                {
                    string path = DateTime.Now.ToString("yyyymmddhhmmss") + ".gif";
                    ClothesShop.BLL.product pro = new ClothesShop.BLL.product();
                    if (pro.updatepic(path, int.Parse(this.Request.QueryString["pid"].ToString())) == 1)
                    {
                        this.picupload.SaveAs(Server.MapPath("../pic/" + path));
                    }
                }
                this.Response.Redirect("editproduct.aspx?pid=" + this.Request.QueryString["pid"].ToString());
            }
            else
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"alert","<script>alert('请选择商品图片')</script>",false);
后面还有 4 行代码,购买后查看完整代码

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

AI 解读 AI

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

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