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;
                }
            }
        }
    }
  • 相关阅读:
    Codeforces 514C Watto and Mechanism(字典树)
    计蒜客 直线的交点(计算几何 + 逆序对)
    Codeforces 837D Round Subset(背包)
    计蒜客 商汤科技的行人检测(随机化+计算几何)
    HDU 5893 List wants to travel(树链剖分+线段树)
    操作系统的中断处理
    Linux 安装 webmin
    Fedora 安装 phpMyAdmin(可能只有自己看得懂)
    httpd编译安装php
    IA-32e架构下的内核初始化内存管理
  • 原文地址:https://www.cnblogs.com/scgw/p/2633832.html
Copyright © 2011-2022 走看看