Discuz.Web/admin/global/thumbnailremoteimage.aspx.cs

(开头部分) 6KB

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

using System;
using System.Web.UI;
using System.Collections;

using Discuz.Control;
using Discuz.Forum;
using Discuz.Config;
using Discuz.Common;
using System.Net;
using System.Web;
using System.IO;


namespace Discuz.Web.Admin
{
    /// <summary>
    /// 时间段设置
    /// </summary>
    public partial class ThumbnailRemoteImage : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AllowShowNavigation = false;
            if (!Page.IsPostBack)
            {
                int w = TypeConverter.StrToInt(DNTRequest.GetString("w"));
                int h = TypeConverter.StrToInt(DNTRequest.GetString("h"));
                if (w > 0)
                {
                    maxWidth.Text = w.ToString();
                }
                if (h > 0)
                {
                    maxHeight.Text = h.ToString();
                }
            }
        }


        private void SaveInfo_Click(object sender, EventArgs e)
        {
            #region 保存设置信息

            if (this.CheckCookie())
            {
                int width = TypeConverter.StrToInt(maxWidth.Text);
                int height = TypeConverter.StrToInt(maxHeight.Text);
                if (width <= 0 || height <= 0 || !IsImage(imageUrl.Text.Trim()))
                {
                    this.reImgUrl.InnerHtml = "<font color='red'>请填入正确的图片地址和宽度高度</font>";
                    return;
                }
                string imgUrl = GetRemoteThumbnail(imageUrl.Text.Trim(), width, height);

                if (imgUrl == string.Empty)
                {
                    this.reImgUrl.InnerHtml = "<font color='red'>生成缩略图失败,请确认图片地址正确后重试</font>";
                }

                this.reImgUrl.InnerHtml = "<img src='" + imgUrl + "' /><br /><br />生成缩略图成功,地址如下:<br /><br /><textarea cols='50' rows='2'>" + imgUrl + "</textarea>";
后面还有 135 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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