如何从byte[]流获取图片保存到本地? byte[] buffer = attach.GetData(0,-1); // 读取该图片的完整2进制流FileStream fs = new FileStream(fileName,FileMode.CreateNew);fs.Write(buffer,0,buffer.Length);fs.Close();得到的图片大小和名字都是正确的,就是图片显示不出来? 好象是要有编码转换?那位大大帮忙解答一下. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public static void getImage(byte[] bt,string path) { BinaryWriter bw; FileStream fs; try { fs=new FileStream(path,FileMode.Create, FileAccess.Write); bw = new BinaryWriter(fs); bw.Write(bt); bw.Flush(); bw.Close(); fs.Close(); } catch { } } fs.Write(buffer,0,buffer.Length);fs.Flush(); //Close前调用Flush是个好习惯,但不知道和你的问题有不有关系fs.Close(); 使用C#给系统增加右键菜单 关于向 sql数据表中 插入主键相同的记录 关于sqldataadapter.update()的问题 关于OdbcCommand.Parameters.add方法中参数名的疑惑 互斥问题提问! 求学!C#组件高手请进!初学用C#来编写自定义组件,请高手指点!!! 怎么制作卸载程序 填充到datagrid后,我想要1个列隐藏不显示可以吗? c# 智能设备数码相框 C#的Codebehind中如何获得HTML页面里用JAVA给dropdownlist的赋值?顶者有分. .net里面有没有控制zmodem传输的类? javascript问题
{
BinaryWriter bw;
FileStream fs;
try
{
fs=new FileStream(path,FileMode.Create, FileAccess.Write);
bw = new BinaryWriter(fs);
bw.Write(bt);
bw.Flush();
bw.Close();
fs.Close();
}
catch
{
}
}
fs.Flush(); //Close前调用Flush是个好习惯,但不知道和你的问题有不有关系
fs.Close();