/// <summary> /// 保存到ftp /// </summary> /// <param name="ftpRoot">ftp服务根目录</param> /// <returns></returns> public override async Task <Uri> SaveAsync(Uri ftpRoot) { using (var stream = new MemoryStream()) { var codec = this.GetCodecInfo(); var parameter = this.GetQaulityEncoderParameter(100); this.bitmap.Save(stream, codec, parameter); var client = new FtpClient(ftpRoot); return(await client.UploadFileAsync(stream, this.FileName)); } }
/// <summary> /// 保存到ftp /// </summary> /// <param name="ftpRoot">ftp服务根目录</param> /// <returns></returns> public virtual async Task <Uri> SaveAsync(Uri ftpRoot) { var client = new FtpClient(ftpRoot); return(await client.UploadFileAsync(this.Stream, this.FileName)); }