日期:2014-05-17 浏览次数:20475 次
public class ImgHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
string path = context.Request.QueryString["imgParth"]+"";
context.Response.ContentType = "image/jpeg";
if (path!="")
{
context.Response.WriteFile(path);
}
else
{
path = context.Server.MapPath("~/Images/error.jpg");
context.Response.WriteFile(path);
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
<img alt=""