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

            }


        }

    }

  • 相关阅读:
    Centos7LDAP LDAPadmin的完整部署记录(改良版,其它文档太多坑)
    linux weblogic11g 部署
    redis离线集群安装
    Weblogic11g 10.3部署
    jdk安装部署
    tar.xz文件如何解压
    linux-Centos7安装python3并与python2共存
    ssh免密码登录配置方法
    Docker容器安装weblogic详细教程
    linux命令分块总结---多操作才是真理
  • 原文地址:https://www.cnblogs.com/goodspeed/p/25564.html
Copyright © 2011-2022 走看看