Deletes the specified directory on the server.
Namespace: System.Net.FtpClient
Assembly: System.Net.FtpClient (in System.Net.FtpClient.dll) Version: 1.0.5064.17461
Syntax
C# |
public void DeleteDirectory(
string path
)
|
Visual Basic |
Public Sub DeleteDirectory (
path As String
)
|
Visual C++ |
public:
virtual void DeleteDirectory(
String^ path
) sealed
|
Parameters
-
path
- Type: System..::..String
The full or relative path of the directory to delete
Implements
IFtpClient..::..DeleteDirectory(String)
Examples
C# |
Copy
|
using System;
using System.Net;
using System.Net.FtpClient;
namespace Examples {
static class DeleteDirectoryExample {
public static void DeleteDirectory() {
using (FtpClient conn = new FtpClient()) {
conn.Host = "localhost";
conn.Credentials = new NetworkCredential("ftptest", "ftptest");
conn.DeleteDirectory("/path/to/directory", true,
FtpListOption.AllFiles | FtpListOption.ForceList);
}
}
}
}
|
See Also