예제 #1
0
        private void btnCleanup_Click(object sender, EventArgs e)
        {
            var confirmResult = MessageBox.Show("Are you sure to want to delete ALL POSTS and UPLOADS, including IMAGES from the blog?",
                         "Confirm Delete!!",
                         MessageBoxButtons.YesNo);
            if (confirmResult != DialogResult.Yes) return;

            var programOptionsFactory = new ProgramOptionsFactory();
            _options = programOptionsFactory.Get();
            if (string.IsNullOrEmpty(_options.FtpUrl))
            {
                MessageBox.Show("In order to delete images, please set up FTP account from settings.");
                return;
            }
            _ftp = new Ftp.Ftp(FtpConfiguration);
            if (!string.IsNullOrEmpty(_ftp.TestConnection()))
            {
                MessageBox.Show("Cannot connect to FTP, please check your settings.");
                return;
            }
            try
            {
                _ftp.DirectoryListingProgressing += FtpDirectoryListingProgressing;
                _ftp.DirectoryListingFetchFinished += FtpDirectoryListingFetchFinished;
                _ftp.DirectoryDeletionProgressing += FtpDirectoryDeletionProgress;
                _ftp.DirectoryDeletionFinished += FtpDirectoryDeletionFinished;
                EnDis(false);
                _ftp.DeleteDirectory("wp-content/uploads/");

            }
            catch (Exception exception)
            {
                EnDis(true);

                MessageBox.Show(exception.ToString());
                Logger.LogExceptions(exception);
            }
        }
예제 #2
0
파일: frmMain.cs 프로젝트: yukseljunk/wps
 private void PrepareTemplates()
 {
     var programOptionsFactory = new ProgramOptionsFactory();
     _options = programOptionsFactory.Get();
     if (string.IsNullOrEmpty(_options.FtpUrl))
     {
         MessageBox.Show("In order to update wp files, please set up FTP account from settings.");
         return;
     }
     var ftp = new Ftp(FtpConfiguration);
     if (!string.IsNullOrEmpty(ftp.TestConnection()))
     {
         MessageBox.Show("Cannot connect to FTP, please check your settings.");
         return;
     }
     var frmPrepareTemplate = new frmPrepareTemplate();
     frmPrepareTemplate.ShowDialog();
 }
예제 #3
0
 private void btnTestFtpConnection_Click(object sender, EventArgs e)
 {
     var ftp = new Ftp.Ftp(FtpConfiguration);
     string result = ftp.TestConnection();
     if (string.IsNullOrEmpty(result))
     {
         MessageBox.Show("Successfull!");
         return;
     }
     MessageBox.Show("Failed: " + result);
 }