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;
                }
            }
        }
    }
  • 相关阅读:
    centos下网络的基本配置方法讲解
    win8.1环境下硬盘安装centos6.5双系统
    新人出世
    Docker 仓库管理
    Docker Dockerfile
    Docker image创建之Hello world
    ASP.Net Core 发布到 Centos Docker
    C# 人工智能
    C#使用ML.Net完成人工智能预测
    无监督和有监督算法的区别
  • 原文地址:https://www.cnblogs.com/scgw/p/2633832.html
Copyright © 2011-2022 走看看