日期:2014-05-17 浏览次数:20425 次
using System;
using System.IO;
namespace test
{
public partial class ImageService : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "application/binary;";
//这个地方图片可以从数据库中读取二进制图片
//byte[] img = DBHelper.ReadImg();
byte[] img = File.ReadAllBytes(Server.MapPath("img") + @"/testImg.jpg");
Response.BinaryWrite(img);
Response.Flush();
Response.End();
}
}
}