FileStream stream = new FileStream(Server.MapPath("./fff.jpg"),FileMode.Open);
long FileSize = stream.Length;
byte[] Buffer = new byte[(int)FileSize];
Response.ContentType = "image/jpg";
stream.Read(Buffer,0,(int)FileSize);
stream.Close();
Response.BinaryWrite(Buffer);
Response.Write(Server.MapPath(@"Images\fff.jpg"));
注意红色部分是后来添加上的,添加这一句之后问题得到解决,另外一个问题是Server.MapPath()指定到根目录,比如我的项目叫Web01,那么这里的路径到
(自定义项目目录)\Web01\Web01\Images\fff.jpg;
转载请注明出处:http://www.cnblogs.com/numen-fan/