原文在这里
http://www.codeproject.com/aspnet/httpImageHandler.asp用vb写的,我已经改写成C#格式了,且已经通过验证。不过最后一步总是弄不好
Configuring IIS to RE-route requests to ASP.NET ISAPI filter
照着例子上去做么有虾米反映,得到的是个500错误#-#  有达人帮帮忙么using System.Drawing;
using System.Web;
namespace myImageHandler
{
public class ImageHandler : IHttpHandler
{
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
ImageWater output = new ImageWater(context.Request.PhysicalPath);
output.AddWaterMark("Welcome to hero4u");
output.image.Save(context.Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);
}//end of ProcessRequest
}
class ImageWater
{ private Bitmap bmp;
public ImageWater(string path)
{
bmp = new Bitmap(path);
} public void AddWaterMark(string water)
{
Font fnt = new Font("宋体",12,FontStyle.Bold);
SolidBrush drawBrush = new SolidBrush(Color.Beige);            Graphics canvas;
try
{
canvas = Graphics.FromImage(bmp);
}
catch
{
Bitmap bmpNew = new Bitmap(bmp.Width,bmp.Height);
canvas = Graphics.FromImage(bmpNew);
canvas.DrawImage(bmp,new Rectangle(0,0,bmpNew.Width,bmpNew.Height)
,0,0,bmp.Width,bmp.Height,GraphicsUnit.Pixel);
bmp = bmpNew;
}
canvas.DrawString(water,fnt,drawBrush,0,0);
        }
public Bitmap image
{
get
{
return bmp;
}
} }

}