using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;
/// <summary> /// Handler 的摘要说明 /// </summary>
public class Handler : IHttpHandler { public Handler() { // // TODO: 在此处添加构造函数逻辑 // } public void ProcessRequest (HttpContext context) { if (context.Request.UrlReferrer.Host == "10.11.43.52") { context.Response.Expires = 0; context.Response.Clear(); context.Response.ContentType = "image/jpg"; context.Response.WriteFile(context.Request.PhysicalPath); context.Response.End(); } else { context.Response.Expires = 0; context.Response.Clear(); context.Response.ContentType = "image/jpg"; context.Response.WriteFile(context.Request.PhysicalApplicationPath+"error.jpg"); context.Response.End(); } } public bool IsReusable { get { return true; } }