/// <summary> /// 当前用户手动删除节点 /// </summary> /// <param name="academicReviewItem">语音实体</param> public void DeleteDiscussInformation(ConferenceAudioItem academicReviewItem) { try { //把需要删除的语音几点交给服务器,让服务器去通知其他终端进行删除的操作 ModelManage.ConferenceAudio.Delete(IMMCodeEnterEntity.ConferenceName, academicReviewItem.AcademicReviewItemTransferEntity, new Action <bool>((result) => { if (result) { //验证是否包含语音 if (!String.IsNullOrEmpty(academicReviewItem.AudioUrl)) { string url = string.Empty; //将其转为ftp的地址,才可以进行ftp的移除(将保存到服务器的语音文件进行删除) if (academicReviewItem.AudioUrl.Contains(IMMCodeEnterEntity.TreeServiceAddressFront)) { //htp路径转成ftp路径 url = academicReviewItem.AudioUrl.Replace(IMMCodeEnterEntity.TreeServiceAddressFront, IMMCodeEnterEntity.ConferenceFtpWebAddressFront); } ThreadPool.QueueUserWorkItem((o) => { //删除子节点所包含的语音文件 FtpManage.DeleteFile(url, IMMCodeEnterEntity.FtpUserName, IMMCodeEnterEntity.FtpPassword); }); } } })); } catch (Exception ex) { LogManage.WriteLog(typeof(ConferenceAudio_View), ex); } }
/// <summary> /// 上传图片 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void imgUPload(string UploadImg) { try { if (string.IsNullOrEmpty(UploadImg)) { return; } //生成一个ftp辅助类() FtpManage ftpHelper = new FtpManage(); //头像地址 string personImgUri = Constant.ConferenceFtpWebAddressFront + Constant.FtpServercePersonImgName; //删除文件 FtpManage.DeleteFile(personImgUri, Constant.FtpUserName, Constant.FtpPassword); //上传头像 ftpHelper.UploadFtp(UploadImg, Constant.LoginUserName + ".png", Constant.ConferenceFtpWebAddressFront + Constant.FtpServercePersonImgName, "/", Constant.FtpUserName, Constant.FtpPassword, delegate(long Length, double progress) { }, delegate(System.Exception error, bool result) { if (result) { //使用异步委托 this.Dispatcher.BeginInvoke(new Action(() => { try { //显示状态 this.txtUPloadTip.Visibility = System.Windows.Visibility.Visible; //过渡一端时间隐藏提示状态 TimerJob.StartRun(new Action(() => { this.txtUPloadTip.Visibility = System.Windows.Visibility.Collapsed; }), 2000); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } })); } }); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }