Hidistro.UI.Common.Controls/UpImg.cs

(开头部分) 9KB

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

namespace Hidistro.UI.Common.Controls
{
    using Hidistro.Core;
    using System;
    using System.ComponentModel;
    using System.IO;
    using System.Runtime.CompilerServices;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class UpImg : WebControl
    {
        private bool isNeedThumbnail = true;
        private string thumbnailUrl100;
        private string thumbnailUrl160;
        private string thumbnailUrl180;
        private string thumbnailUrl220;
        private string thumbnailUrl310;
        private string thumbnailUrl40;
        private string thumbnailUrl410;
        private string thumbnailUrl60;
        private string uploadedImageUrl = string.Empty;

        public UpImg()
        {
            this.UploadType = Hidistro.UI.Common.Controls.UploadType.Product;
            this.UploadSize = "";
        }

        private bool CheckFileExists(string imageUrl)
        {
            if (!this.CheckFileFormat(imageUrl))
            {
                return false;
            }
            if (imageUrl.ToLower().IndexOf("http://") < 0)
            {
                return File.Exists(this.Page.Request.MapPath(Globals.ApplicationPath + imageUrl));
            }
            return true;
        }

        private bool CheckFileFormat(string imageUrl)
        {
            if (!string.IsNullOrEmpty(imageUrl))
            {
                string str = imageUrl.ToUpper();
                if ((str.Contains(".JPG") || str.Contains(".GIF")) || ((str.Contains(".PNG") || str.Contains(".BMP")) || str.Contains(".JPEG")))
                {
                    return true;
                }
            }
            return false;
        }

        protected override void CreateChildControls()
        {
            this.Controls.Clear();
            string webResourceUrl = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "Hidistro.UI.Common.Controls.ImageUploader.images.upload.png");
            WebControl child = new WebControl(HtmlTextWriterTag.Div);
后面还有 216 行代码,购买后查看完整代码

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

AI 解读 AI

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

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