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