Esempio n. 1
0
        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!");
        }
Esempio n. 2
0
        public IEnumerable <string> Get()
        {
            FtpUtility ftp = new FtpUtility();

            ftp.Ftp();
            IEnumerable <string> res = valueService.GetValues();

            _log.LogInformation(res.ToString());
            return(res);
        }
Esempio n. 3
0
        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!");
            }
        }