图片以二进制流输出

//图片以二进制流输出 private void ReaderImgBinary(){ System.IO.FileStream fs=new FileStream(@"D:/test.jpg",FileMode.Open,FileAccess.Read); byte[] mydata=new byte[fs.Length]; int length=Convert.ToInt32(fs.Length); fs.Read(mydata,0,length); fs.Close(); Response.OutputStream.Write(mydata,0,length); this.Response.End(); }

你可能感兴趣的:(asp.net)