public List <string> GetShareImage(int user_id, string appid) { try { dm_userEntity dm_UserEntity = GetEntityByCache(user_id); if (dm_UserEntity.IsEmpty()) { throw new Exception("用户信息异常!"); } if (dm_UserEntity.headpic.IsEmpty()) { throw new Exception("您先上传个人头像!"); } List <string> shareList = new List <string>(); string basePath = System.AppDomain.CurrentDomain.BaseDirectory.TrimEnd("\\".ToCharArray()); string newPath1 = "/Resource/ShareImage/Share" + user_id + "1.jpg"; string newPath2 = "/Resource/ShareImage/Share" + user_id + "2.jpg"; string newPath3 = "/Resource/ShareImage/Share" + user_id + "3.jpg"; dm_basesettingEntity dm_BasesettingEntity = dm_BaseSettingService.GetEntityByCache(appid); if (File.Exists(basePath + newPath1) && File.Exists(basePath + newPath2) && File.Exists(basePath + newPath3)) { shareList.Add(dm_BasesettingEntity.qianzhui_image + newPath1); shareList.Add(dm_BasesettingEntity.qianzhui_image + newPath2); shareList.Add(dm_BasesettingEntity.qianzhui_image + newPath3); } else { Bitmap qrCode = QRCodeHelper.Generate3(dm_UserEntity.invitecode, 200, 200, basePath + dm_UserEntity.headpic); //背景图片,海报背景 string path1 = basePath + @"/Resource/ShareImage/1.jpg"; string path2 = basePath + @"/Resource/ShareImage/2.jpg"; string path3 = basePath + @"/Resource/ShareImage/3.jpg"; GeneralShareImage(basePath + newPath1, path1, qrCode); shareList.Add(dm_BasesettingEntity.qianzhui_image + newPath1); GeneralShareImage(basePath + newPath2, path2, qrCode); shareList.Add(dm_BasesettingEntity.qianzhui_image + newPath2); GeneralShareImage(basePath + newPath3, path3, qrCode); shareList.Add(dm_BasesettingEntity.qianzhui_image + newPath3); } return(shareList); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } throw ExceptionEx.ThrowServiceException(ex); } }