Session.RemoveFiles Method

Removes one or more remote files.

When removing one specific file only, consider using a convenient alternative Session.RemoveFiles, which is easier to use.

Advertisement

Syntax

C#
public RemovalOperationResult RemoveFiles(string path)
VB.NET
Public Function RemoveFiles(path As String) As RemovalOperationResult

Parameters

Name Description
string path Full path to remote directory followed by slash and wildcard to select files or subdirectories to remove.

Return Value

RemovalOperationResult. See also Capturing results of operations.

Exceptions

Exception Condition
InvalidOperationException Session is not opened.
SessionLocalException Error communicating with winscp.com.
See the exception documentation for details.
SessionRemoteException Session has failed.
Removing of files has failed.
See the exception documentation for details.
TimeoutException Timeout waiting for winscp.com to respond.

Advertisement

Examples

Real-Life Example

Last modified: by martin