Delets 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,
bool force
)
|
Visual Basic |
Public Sub DeleteDirectory (
path As String,
force As Boolean
)
|
Visual C++ |
public:
virtual void DeleteDirectory(
String^ path,
bool force
) sealed
|
Implements
IFtpClient..::..DeleteDirectory(String, Boolean)
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