FileStream fs = new FileStream(Server.MapPath("images/DSC_0290.JPG"), FileMode.Open);//将图片文件存在文件流中
long fslength = fs.Length;//流长度
byte[] b1 = new byte[(int)fslength];//定义二进制数组
fs.Read(b1, , (int)fslength);//将流中字节写入二进制数组中
fs.Close();//关闭流 //Response.ContentType = "image/jpeg";
//Response.BinaryWrite(b1);//将图片输出在页面
Response.Clear();
Response.ContentType = "image/jpg";
Response.BinaryWrite(b1);