zoukankan      html  css  js  c++  java
  • DtCms.Web.Tools.Http_ImgLoad.ashx.cs

    using System;
    using System.Web;
    using DtCms.Common;
    using System.IO;
      
    namespace DtCms.Web.Tools
    {
        /// <summary>
        /// 显示缩略图
        /// </summary>
        public class Http_ImgLoad : IHttpHandler
        {
      
            public void ProcessRequest(HttpContext context)
            {
                int strW;
                int strH;
                if (int.TryParse(context.Request.Params["w"], out strW) && int.TryParse(context.Request.Params["h"], out strH))
                {
                    context.Response.Clear();
                    string gurl = context.Request.Params["gurl"];
                    if (!string.IsNullOrEmpty(gurl))
                    {
                        if (File.Exists(context.Server.MapPath(gurl)))
                        {
                            LoadImage.GenThumbnail(context.Request.Params["gurl"], strW, strH);
                        }
                        else
                        {
                            LoadImage.GenThumbnail("/images/nopic.gif", strW, strH);
                        }
                    }
                    else
                    {
                        LoadImage.GenThumbnail("/images/nopic.gif", strW, strH);
                    }
                }
            }
      
            public bool IsReusable
            {
                get
                {
                    return false;
                }
            }
        }
    }
  • 相关阅读:
    css2D转换和3D转换
    css过渡和动画
    Sublime Text、webstorm等编译器快速编写HTML/CSS代码的技巧
    纯CSS制作各种各样的网页图标(三角形、暂停按钮、下载箭头、加号等)
    Vue:渲染、指令、事件、组件、Props
    CSS Grid 网格布局全解析
    flex 布局的深入研究
    数组的迭代方法(every、filter、forEach、map、some)
    You-need-to-know-css
    两列布局
  • 原文地址:https://www.cnblogs.com/scgw/p/2633832.html
Copyright © 2011-2022 走看看