Executes a command
Namespace: System.Net.FtpClient
Assembly: System.Net.FtpClient (in System.Net.FtpClient.dll) Version: 1.0.5064.17461
Syntax
C# |
---|
public FtpReply Execute(
string command,
params Object[] args
) |
Visual Basic |
---|
Public Function Execute (
command As String,
ParamArray args As Object()
) As FtpReply |
Visual C++ |
---|
public:
virtual FtpReply Execute(
String^ command,
... array<Object^>^ args
) sealed |
Return Value
Type:
FtpReplyThe servers reply to the command
Implements
IFtpClient..::..Execute(String, array<Object>[]()[][])
Examples
C# |
Copy
|
using System;
using System.Net;
using System.Net.FtpClient;
namespace Examples {
static class ExecuteExample {
public static void Execute() {
using (FtpClient conn = new FtpClient()) {
FtpReply reply;
conn.Host = "localhost";
conn.Credentials = new NetworkCredential("ftptest", "ftptest");
if (!(reply = conn.Execute("SITE CHMOD 640 FOO.TXT")).Success) {
throw new FtpCommandException(reply);
}
}
}
}
}
|
See Also