PowerTCP FTP for .NET
Delete(String) Method
Example 



Absolute or relative path to the file.
Sends the "DELE" command to the server.
Syntax
Public Overloads Function Delete( _
   ByVal path As String _
) As Response
Dim instance As Ftp
Dim path As String
Dim value As Response
 
value = instance.Delete(path)
public Response Delete( 
   string path
)
public:
Response^ Delete( 
   String^ path
) 

Parameters

path
Absolute or relative path to the file.

Return Value

Exceptions
ExceptionDescription
FtpProtocolExceptionThe command did not succeed.
Example
This example demonstrates using the FTP control to delete files and subdirectories.
private void deleteFiles()
{
    //Delete a list of files (in this case, the txt files).
    ftp1.Delete(ftp1.ListDirectoryTree("MyTextFiles", "*.txt", false));

    //Delete a specific file.
    ftp1.Delete("MyTextFiles/test.dat");

    //Delete the directory, even when it is not empty.
    ftp1.DeleteDirectory("MyTextFiles");
}
Private Sub deleteFiles()
    'Delete a list of files (in this case, the txt files).
    ftp1.Delete(ftp1.ListDirectoryTree("MyTextFiles", "*.txt", False))

    'Delete a specific file.
    ftp1.Delete("MyTextFiles/test.dat")

    'Delete the directory, even when it is not empty.
    ftp1.DeleteDirectory("MyTextFiles")
End Sub
See Also

Reference

Ftp Class
Ftp Members
Overload List


PowerTCP FTP for .NET Documentation Version 6.1
© 2023 Dart Communications. All Rights Reserved.
Send comments on this topic