MemoryStream ms=new MemoryStream();
using (FileStream fs = new FileStream("C:\\1.jpg", FileMode.Create))
{
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(ms.ToArray());
bw.Close();
fs.Flush();
}
转载于:https://www.cnblogs.com/newmin/archive/2011/03/23/1992163.html