public override void Start() { //FtpHelper ftpHelper = new FtpHelper(user, pwd); //try //{ // ftpHelper.DeleteFile(url); // DisplayMessage("Remove file completed!"); //} //catch (Exception exception) //{ // DisplayMessage(exception.ToExceptionContent().ToString()); //} //try //{ // ftpHelper.DeleteDirectory(url); // DisplayMessage("Remove directory completed!"); //} //catch (Exception exception) //{ // DisplayMessage(exception.ToExceptionContent().ToString()); //} OperationResult result = FtpUtility.Delete(user, pwd, url); DisplayMessage(result.Message); DisplayMessage("Completed!"); }
public IEnumerable <string> Get() { FtpUtility ftp = new FtpUtility(); ftp.Ftp(); IEnumerable <string> res = valueService.GetValues(); _log.LogInformation(res.ToString()); return(res); }
private void loadfiles() { var ftp = new FtpUtility(); ftp.UserName = "******"; ftp.Password = "******"; ftp.Path = ftppath; try { bsource = new BindingSource(); bsource.DataSource = ftp.ListFiles().Select(x => new { Path = ftp.Path + x, Name = x }).ToList(); } catch (Exception ex) { MessageBox.Show("Something happened, please try again.\n\n" + ex.Message.ToString(), "Error!"); } }