/// <summary>
 /// base64str转为图片保存
 /// </summary>
 /// <param name="base64str">base64str字符串</param>
 private string Base64stringToImage(string base64str, int photo_type, string imagename, out int image_id)
 {
     string dir = string.Empty;
     image_id = 0;
     try
     {
         var butter = Convert.FromBase64String(base64str);
         MemoryStream ms = new MemoryStream(butter);
         Bitmap bitmap = new Bitmap(ms);
         if (string.IsNullOrWhiteSpace(imagename))
         {
             dir = string.Format("/UploadImage/{0}.jpg", Guid.NewGuid().ToString());
         }
         else
         {
             dir = string.Format("/Content/Images/language/{0}.jpg", imagename);
         }
         photoDomainObject photo = new photoDomainObject() { photo_imageurl = dir, photo_typeid = photo_type };
         var Photo = photoservice.AddEntity(photo);
         image_id = Photo.photo_id;
         bitmap.Save(HttpContext.Current.Server.MapPath(dir), System.Drawing.Imaging.ImageFormat.Jpeg);
         ms.Close();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return dir;
 }
        private string Base64stringToQINIU(string base64str, int photo_type, string imagename, out int image_id)
        {
            string dir = string.Empty;
            image_id = 0;
            try
            {
                var butter = Convert.FromBase64String(base64str);
                Stream stream = new MemoryStream(butter);

                #region 七牛操作 —— 上传图片

                var token = GetToken();
                PutExtra extra = new PutExtra();
                Qiniu.IO.IOClient client = new IOClient();
                var date = DateTime.Now;
                var key = date.Year.ToString() + (date.Month + 1).ToString() + date.Day.ToString() + date.Hour.ToString() + date.Minute.ToString() + date.Second.ToString() + date.Millisecond.ToString() + ".jpg";

                PutRet ret = client.Put(token, key, stream, extra);

                #endregion

                photoDomainObject photo = new photoDomainObject() { photo_imageurl = ret.key, photo_typeid = photo_type };
                var Photo = photoservice.AddEntity(photo);
                image_id = Photo.photo_id;
                dir = AllConfig.QiNiuConfig(WebCommon.Get_AppSetting("QiNiuUrl"),ret.key); 
                //string.Format("{0}{1}", WebCommon.GetAppSetting("key"), ret.key);

            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dir;
        }