Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// HANDLER
- /// HANDLER
- /// HANDLER
- /// HANDLER
- /// HANDLER
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Drawing.Imaging;
- using System.Linq;
- using System.Web;
- namespace WebApplication3
- {
- /// <summary>
- /// Summary description for Handler1
- /// </summary>
- public class Handler1 : IHttpHandler
- {
- public void ProcessRequest(HttpContext context)
- {
- String dta = context.Request.QueryString["data"];
- context.Response.ContentType = "image/jpg";
- Bitmap b = new Bitmap(context.Server.MapPath("~/App_Data/"+dta+".jpg"));
- b.Save(context.Response.OutputStream, ImageFormat.Jpeg);
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
- }
- /// PAGE - LAYOUT
- /// PAGE - LAYOUT
- /// PAGE - LAYOUT
- /// PAGE - LAYOUT
- /// PAGE - LAYOUT
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="WebApplication3._default" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <img src="Handler1.ashx?data=<%= prms %>">
- </div>
- </form>
- </body>
- </html>
- /// PAGE
- /// PAGE
- /// PAGE
- /// PAGE
- /// PAGE
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- namespace WebApplication3
- {
- public partial class _default : System.Web.UI.Page
- {
- public String prms = "asd";
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement