FtpClient.OpenWrite Method (Uri, Boolean, FtpDataType)
From System.Net.FtpClient
|
|
| System.Net.FtpClient |
| FtpClient..::..OpenWrite Method (Uri, Boolean, FtpDataType) |
| FtpClient Class Example See Also Send Feedback |
|
|
Opens a stream to the file specified by the URI
Namespace: System.Net.FtpClient
Assembly: System.Net.FtpClient (in System.Net.FtpClient.dll) Version: 1.0.5064.17461
Syntax
| C# |
|---|
public static Stream OpenWrite( Uri uri, bool checkcertificate, FtpDataType datatype ) |
| Visual Basic |
|---|
Public Shared Function OpenWrite ( uri As Uri, checkcertificate As Boolean, datatype As FtpDataType ) As Stream |
| Visual C++ |
|---|
public: static Stream^ OpenWrite( Uri^ uri, bool checkcertificate, FtpDataType datatype ) |
Parameters
- uri
- Type: System..::..Uri
FTP/FTPS URI pointing at a file
- checkcertificate
- Type: System..::..Boolean
Indicates if a ssl certificate should be validated when using FTPS schemes
- datatype
- Type: System.Net.FtpClient..::..FtpDataType
ASCII/Binary mode
Return Value
Type: StreamStream object
Examples
| C# |
|
|---|---|
using System; using System.IO; using System.Net.FtpClient; namespace Examples { static class OpenWriteURI { public static void OpenURI() { using (Stream s = FtpClient.OpenWrite(new Uri("ftp://server/path/file"))) { try { // write data to the file on the server } finally { s.Close(); } } } } } |
|
See Also