Deletes a file 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 DeleteFile(
string path
)
|
Visual Basic |
Public Sub DeleteFile (
path As String
)
|
Visual C++ |
public:
virtual void DeleteFile(
String^ path
) sealed
|
Implements
IFtpClient..::..DeleteFile(String)
Examples
C# |
Copy
|
using System;
using System.Net;
using System.Net.FtpClient;
namespace Examples {
static class DeleteFileExample {
public static void DeleteFile() {
using (FtpClient conn = new FtpClient()) {
conn.Host = "localhost";
conn.Credentials = new NetworkCredential("ftptest", "ftptest");
conn.DeleteFile("/full/or/relative/path/to/file");
}
}
}
}
|
See Also