Opens the specified file for writing
Namespace: System.Net.FtpClient
Assembly: System.Net.FtpClient (in System.Net.FtpClient.dll) Version: 1.0.5064.17461
Syntax
C# |
---|
public Stream OpenWrite(
string path
) |
Visual Basic |
---|
Public Function OpenWrite (
path As String
) As Stream |
Visual C++ |
---|
public:
virtual Stream^ OpenWrite(
String^ path
) sealed |
Return Value
Type:
StreamA stream for writing to the file on the server
Implements
IFtpClient..::..OpenWrite(String)
Examples
C# |
Copy
|
using System;
using System.IO;
using System.Net;
using System.Net.FtpClient;
namespace Examples {
public class OpenWriteExample {
public static void OpenWrite() {
using (FtpClient conn = new FtpClient()) {
conn.Host = "localhost";
conn.Credentials = new NetworkCredential("ftptest", "ftptest");
using (Stream ostream = conn.OpenWrite("/full/or/relative/path/to/file")) {
try {
}
finally {
ostream.Close();
}
}
}
}
}
}
|
See Also