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;
                }
            }
        }
    }
  • 相关阅读:
    linux 安装Python3
    MYSQL 字符集设置(终端的字符集)
    Linux LVM Logical Volume Management 逻辑卷的管理
    oracle 重命名和重定位数据文件(Oracle Renaming and Relocating Datafiles)
    Azkaban编译
    基于hive的transform实现自定义分隔符数据导出
    MapReduce优化设置
    hive.groupby.skewindata环境变量与负载均衡
    hive的基本操作
    Shell 数组的定义和使用
  • 原文地址:https://www.cnblogs.com/scgw/p/2633832.html
Copyright © 2011-2022 走看看