Creates a directory on the server. If the preceding
directories do not exist they are created.
Namespace: System.Net.FtpClient
Assembly: System.Net.FtpClient (in System.Net.FtpClient.dll) Version: 1.0.5064.17461
Syntax
C# |
public void CreateDirectory(
string path
)
|
Visual Basic |
Public Sub CreateDirectory (
path As String
)
|
Visual C++ |
public:
virtual void CreateDirectory(
String^ path
) sealed
|
Implements
IFtpClient..::..CreateDirectory(String)
Examples
C# |
Copy
|
using System;
using System.Net;
using System.Net.FtpClient;
using System.IO;
namespace Examples {
public static class CreateDirectoryExample {
public static void CreateDirectory() {
using (FtpClient conn = new FtpClient()) {
conn.Host = "localhost";
conn.Credentials = new NetworkCredential("ftptest", "ftptest");
conn.CreateDirectory("/test/path/that/should/be/created", true);
}
}
}
}
|
See Also