Deletes the specified files from the specified FTP server, specifying a port, a username/password, an authentication method, verification flags, a certificate, data channel protection, whether the operation is recursive and/or passive, whether authentication is implicit, a proxy, a time-out, default representation type, a synchronizing object, and delegates for notifications.
Syntax
'Declaration
Public Overloads Shared Sub Delete( _
ByVal As String, _
ByVal As Integer, _
ByVal As String, _
ByVal As String, _
ByVal As AuthenticationMethod, _
ByVal As VerificationFlags, _
ByVal As Certificate, _
ByVal As DataChannelProtection, _
ByVal As Boolean, _
ByVal As Boolean, _
ByVal As ProxyClient, _
ByVal As Integer, _
ByVal As Boolean, _
ByVal As RepresentationType, _
ByVal As TextWriter, _
ByVal As ISynchronizeInvoke, _
ByVal As QuickFtp.CertificateReceivedCallback, _
ByVal As QuickFtp.CertificateRequiredCallback, _
ByVal As Object, _
ByVal ParamArray () As String _
)
'Usage
Dim hostname As String
Dim port As Integer
Dim username As String
Dim password As String
Dim authenticationMethod As AuthenticationMethod
Dim verificationFlags As VerificationFlags
Dim clientCertificate As Certificate
Dim dataChannelProtection As DataChannelProtection
Dim implicitAuthentication As Boolean
Dim recursive As Boolean
Dim proxy As ProxyClient
Dim timeout As Integer
Dim passiveTransfer As Boolean
Dim defaultRepresentationType As RepresentationType
Dim traceWriter As TextWriter
Dim synchronizingObject As ISynchronizeInvoke
Dim certificateReceivedCallback As QuickFtp.CertificateReceivedCallback
Dim certificateRequiredCallback As QuickFtp.CertificateRequiredCallback
Dim userParams As Object
Dim filesToDelete() As String
QuickFtp.Delete(hostname, port, username, password, authenticationMethod, verificationFlags, clientCertificate, dataChannelProtection, implicitAuthentication, recursive, proxy, timeout, passiveTransfer, defaultRepresentationType, traceWriter, synchronizingObject, certificateReceivedCallback, certificateRequiredCallback, userParams, filesToDelete)
public static void Delete(
string ,
int ,
string ,
string ,
AuthenticationMethod ,
VerificationFlags ,
Certificate ,
DataChannelProtection ,
bool ,
bool ,
ProxyClient ,
int ,
bool ,
RepresentationType ,
TextWriter ,
ISynchronizeInvoke ,
QuickFtp.CertificateReceivedCallback ,
QuickFtp.CertificateRequiredCallback ,
object ,
params string[]
)
Parameters
- hostname
- The hostname of the FTP server to connect to. An IP address can also be used.
- port
- The port number on the FTP server to use.
- username
- The username used to connect to the FTP server.
- password
- The password used to connect to the FTP server.
- authenticationMethod
- The authentication method used to connect to the FTP server. Not applicable to the Compact Framework version.
- verificationFlags
- The verification flags used to verify the FTP server's certificate. Not applicable to the Compact Framework version.
- clientCertificate
- The certificate used when connecting to the FTP server. Can be null. Not applicable to the Compact Framework version.
- dataChannelProtection
- The DataChannelProtection used during the communication. Ignored if is true. Not applicable to the Compact Framework version.
- implicitAuthentication
- If true, the SSL handshake occurs at the very beginning of the connection; otherwise, the AUTH command is sent after the Welcome message to initiate the SSL handshake. Not applicable to the Compact Framework version.
- recursive
- Boolean value indicating whether files contained within sub-folders should be deleted from the FTP host.
- proxy
- The active proxy client for connecting to the FTP server.
- timeout
- The period of time, in seconds, after which an FTP operation should timeout.
- passiveTransfer
- Boolean value indicating whether the data connection should be established by the FTP server rather than by the client-side.
- defaultRepresentationType
- The default value indicating how the data is transferred to and from the FTP server.
- traceWriter
- The System.IO.TextWriter which will trace the communications between the client-side and the FTP server.
- synchronizingObject
- The object used to automatically redirect events on the main UI thread. Not applicable to the Compact Framework version.
- certificateReceivedCallback
- Delegate for CertificateReceived notification. Not applicable to the Compact Framework version.
- certificateRequiredCallback
- Delegate for CertificateRequired notification. Not applicable to the Compact Framework version.
- userParams
- Opaque data that will be passed back to the event handler when an event is raised.
- filesToDelete
- A list of strings representing the files to delete. File paths may not start with a \ or a /. If a path represents a folder, it must end with a / or a \.
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also