复制代码 代码如下:
 
<system.web> 
<urlMappings enabled="true"> 
<add url="~/Default.aspx" mappedUrl="~/Handler.ashx"/> 
</urlMappings> 
复制代码 代码如下:
 
using System; 
using System.Web; 
public class Handler : IHttpHandler { 
public void ProcessRequest (HttpContext context) { 
// Comment out these lines first: 
// context.Response.ContentType = "text/plain"; 
// context.Response.Write("Hello World"); 
context.Response.ContentType = "image/png"; 
context.Response.WriteFile("~/Flower1.png"); 
} 
public bool IsReusable { 
get { 
return false; 
} 
} 
} 
新闻热点
疑难解答
图片精选