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; }

            }


        }

    }

  • 相关阅读:
    IDEA+SpringMVC+Spring+Mybatis
    WSDL详解
    cxf的使用
    cxf使用wsdl文件生成代码
    给你的博客加上“Fork me on Github”彩带(转)
    老毛桃pe装机工具一键还原系统
    老毛桃pe装机工具备份系统
    java项目中classpath路径到底指的是哪里?
    this.class.getClassLoader().getResourceAsStream与this.class.getResourceAsStream
    Eclipse中导入项目后js报错解决方法(转未解决问题)
  • 原文地址:https://www.cnblogs.com/goodspeed/p/25564.html
Copyright © 2011-2022 走看看