码迷,mamicode.com
首页 > 其他好文 > 详细

WCF存储图片到指定文件夹下

时间:2016-01-18 13:52:47      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:

         string path = System.IO.Directory.GetCurrentDirectory() + @"\POIImages\";
         Guid imgid = Guid.NewGuid();
byte[] ImageByte = Convert.FromBase64String(pic);

/// <summary> /// 存储图片 /// </summary> /// <param name="ImageByte"></param> /// <returns></returns> public void SaveImage(byte[] ImageByte,Guid imgid,string path) { //string path = System.IO.Directory.GetCurrentDirectory() + @"\POIImages\"; FileStream fileStream = null; FileInfo fileInfo = new FileInfo(path + imgid+".png"); fileStream = fileInfo.OpenWrite(); fileStream.Write(ImageByte, 0, ImageByte.Length); fileStream.Close(); }

 

WCF存储图片到指定文件夹下

标签:

原文地址:http://www.cnblogs.com/bobo-show/p/5138951.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!