zoukankan      html  css  js  c++  java
  • ASP.Net之瞒天过海

     

    using System;
    using
     System.Web;
    using
     System.Drawing;
    using
     System.Drawing.Imaging;
    using
     System.Net;
    using
     System.IO;

    namespace
     Goodspeed.test.httphandle
    {

        
    public class
     myjpg : IHttpHandler
        
    {
            
    public myjpg() { }


            
    public void ProcessRequest(HttpContext Context)
            
    {
                HttpResponse Response 
    =
     Context.Response;
                HttpRequest Request 
    =
     Context.Request;
                
    string Url =
     Request.Url.ToString();
                
    //Url = "http://www.allinone.net.cn/office/photo/pic/20040714/" + Url.Substring(Url.LastIndexOf("/") + 1);

                Url = "http://img1.qq.com/news/20040721/490452.jpg";

                Response.ContentType 
    = "image/JPEG"
    ;

                WebClient wc 
    = new
     WebClient();
                Stream resStream 
    =
     wc.OpenRead(Url);
                Image originalimage 
    = Image.FromStream(resStream);//获取图像


                
    方法二

                
    水印

                originalimage.Save(Response.OutputStream, ImageFormat.Jpeg);
                Response.End();
                originalimage.Dispose();
                wc.Dispose();
            }


            
    public bool IsReusable
            
    {
                
    get return true; }

            }


        }

    }

  • 相关阅读:
    stm32f103和stm32f407的GPIO口模式设置以及相互对应的关系
    基于STM32单片机实现屏幕休眠后OLED屏幕滚动效果
    基于51单片机的超声波模块HC-SR04的使用
    用51单片机控制L298N电机驱动模块
    学习笔记——51单片机 单片机与单片机之间的通讯
    基于51单片机的电子密码锁—1
    LCD1602学习调试
    基于51单片机,通过定时器实现的时钟程序
    有进度条圆周率计算
    python turtle 学习笔记
  • 原文地址:https://www.cnblogs.com/goodspeed/p/25564.html
Copyright © 2011-2022 走看看