示例#1
0
        /// <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));
            }
        }
示例#2
0
        /// <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));
        }