private async void bn_downFile2_Click(object sender, EventArgs e) { string BaseFTPpath = tb_FTPpath2.Text; string FTPusername = tb_username2.Text; string FTPpassword = tb_password2.Text; string FTPoutpath = tb_filedownPath2.Text; string fileRelatedInfo = tb_fileRelatedInfo.Text; FTPdownload ftp = new FTPdownload(FTPusername, FTPpassword, BaseFTPpath); await FTPdownloadAllAsync(BaseFTPpath, FTPoutpath, fileRelatedInfo, FTPusername, FTPpassword, Pb_download); }
Task FTPdownloadAllAsync(string baseFTPpath, string filePath, string related, string FTPusername, string FTPpassword, ProgressBar pb) { FTPdownload ftp = new FTPdownload(FTPusername, FTPpassword, baseFTPpath); return(Task.Run(() => ftp.DownloadAllRelated(baseFTPpath, filePath, related, pb))); }
Task <bool> FTPdownloadAsync(string FTPURL, string filePath, string FTPusername, string FTPpassword, ProgressBar pb) { return(Task.Run(() => FTPdownload.Download(FTPURL, filePath, FTPusername, FTPpassword, pb))); }