摘要: var ms=new MemoryStream(byte[] bytes); using(var fs=new FileStream(路径 例如:"D:\image\myimage.jpg")){ ms.writeto(fs);} 阅读全文
posted @ 2013-01-10 11:58 开发人员的生涯 阅读(1512) 评论(0) 推荐(0) 编辑
摘要: /// <summary>/// 字节数组生成图片/// </summary>/// <param name="Bytes">字节数组</param>/// <returns>图片</returns>private Image ByteArrayToImage(byte[] bytes){ using (MemoryStream ms = new MemoryStream(bytes)) { var image= Image.FromStream(ms); return imag... 阅读全文
posted @ 2013-01-10 11:54 开发人员的生涯 阅读(360) 评论(0) 推荐(0) 编辑
摘要: //文件名称string path = this.UpFile.PostedFile.FileName;//文件大小int size = this.UpFile.PostedFile.ContentLength;//文件类型string type = this.UpFile.PostedFile.ContentType;var bytes= new byte[size];using(MemoryStream stream = this.UpFile.PostedFile.InputStream){ stream.Read(bytes, 0, size);} 阅读全文
posted @ 2013-01-10 11:51 开发人员的生涯 阅读(322) 评论(0) 推荐(0) 编辑