YKT_EShop/Admin/Picture/UploadLogo.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using YKT_Common;
using System.Web.UI.HtmlControls ;
namespace YKT_EShop.Admin.Picture
{
    public partial class UploadLogo : BasicPage
    {
        protected FileUpload FileUpload1;
        string newPath = "logo";
        protected HtmlImage view;
        protected void Page_Load(object sender, EventArgs e)
        {
            view.Src = "~/UpLoadFiles/logo/" + config.TemplatePath+".gif";
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.FileUpload1.FileName == "")
            {
                Js.Alert("请选择一个图片!");
                return;
            }
            string fileName = Path.GetFileName(this.FileUpload1.FileName);
            string extension = Path.GetExtension(this.FileUpload1.FileName);
            string filePath = DateTime.Now.ToString("yyyyMMdd");
            string path1 = Server.MapPath("~/UpLoadFiles/" + newPath + "/");
            if (!Directory.Exists(path1))
            {
                Directory.CreateDirectory(path1);
            }
            string fileName1 = DateRndName();
            //path1 = path1 + fileName1 + extension;
            fileName = config.TemplatePath + ".gif";
            path1 = path1 + fileName;
            string path2 = "/UpLoadFiles/" +  newPath + "/" + fileName;
            try
            {
                this.FileUpload1.SaveAs(path1);
                this.ClientScript.RegisterStartupScript(this.GetType(), "upload", "<script>returnValue('" + path2 + "');</script>");
            }
            catch
            {
                throw new Exception();
            }
        }

        /// <summary>
        /// 日期
        /// </summary>
        /// <returns></returns>
        private string DateRndName()
        {
            DateTime d = DateTime.Now;
            string s = null, y, m, dd, h, mm, ss;
后面还有 16 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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