Beispiel #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();
         }
     }
 }
Beispiel #2
0
 public void DeleteFile(string Path)
 {
     _client.DeleteFile(Path);
 }
 public override bool DeleteFile(string remotePath)
 {
     _client.DeleteFile(remotePath);
     return(true);
 }