显示BYTE流图片

string pathName=@"D:\VS 2008\LotterySystem\Space\images\StandLevel\soldier1.jpg";
   FileStream fs = new FileStream(pathName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
   byte[] imgByte2=new byte[fs.Length];
   fs.Read(imgByte2, 0, (int)fs.Length);
   fs.Close();
   Object o=imgByte2;
   byte[] imgByte=(byte[])o;
   Response.ClearContent();
   Response.ContentType = "image/Jpeg";
   Response.OutputStream.Write(imgByte,0,imgByte.Length); 
posted @ 2009-11-06 15:29  小さいです哥  阅读(348)  评论(0编辑  收藏  举报