Exemplo n.º 1
0
 private void DeleteFolderFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (ServerFilesTree.SelectedNode.Text.Contains('.'))
     {
         try
         {
             FtpConnection.DeleteFile(ServerFilesTree.SelectedNode.Tag.ToString());
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error Deleting File: " + ex.Message);
             return;
         }
         finally
         {
             ServerFilesTree.SelectedNode.Remove();
         }
     }
     else
     {
         try
         {
             FtpConnection.DeleteDirectory(ServerFilesTree.SelectedNode.Tag.ToString());
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error Deleting Folder: " + ex.Message);
             return;
         }
         finally
         {
             ServerFilesTree.SelectedNode.Remove();
         }
     }
 }
Exemplo n.º 2
0
 public void DeleteFolder(string folderPath)
 {
     using (var client = new FluentFTP.FtpClient(env.FTP_HOST, new NetworkCredential(env.FTP_USERNAME, env.FTP_PASSWORD)))
     {
         client.DeleteDirectory(folderPath);
     }
 }
Exemplo n.º 3
0
 public void DeleteDirectory(string Path)
 {
     _client.DeleteDirectory(Path);
 }
Exemplo n.º 4
0
 public override bool DeleteDirectory(string remotePath)
 {
     _client.DeleteDirectory(remotePath);
     return(true);
 }