使用response对象输出图像
string path ="G:\\yangkai\\MyCode\\MyAsp\\Cp9\\picture\\stk.jpg";
FileStream fs = new FileStream(path,FileMode.Open,FileAccess.Read);
if(fs==null)
{
return;
}
byte [] data=new byte[(int)fs.Length];
fs.Read(data,0,(int)fs.Length);
Response.BinaryWrite(data);
Response.ContentType= "image/pjpeg";