标签:关闭 class san net 文件流 images 图片 file map
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, 0, (int)fslength);//将流中字节写入二进制数组中
fs.Close();//关闭流
//Response.ContentType = "image/jpeg";
//Response.BinaryWrite(b1);//将图片输出在页面
Response.Clear();
Response.ContentType = "image/jpg";
Response.BinaryWrite(b1);
标签:关闭 class san net 文件流 images 图片 file map
原文地址:https://www.cnblogs.com/cutdragonhit/p/9694813.html