コード例 #1
0
        /// <summary>
        /// 从ftp删除
        /// </summary>
        /// <param name="ftpRoot">ftp服务根目录</param>
        /// <returns></returns>
        public async Task <bool> DeleteAsync(Uri ftpRoot)
        {
            var client = new FtpClient(ftpRoot);

            return(await client.DeleteFileAsync(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));
        }