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 virtual Stream OpenRead(
string path,
FtpDataType type,
long restart
) |
| Visual Basic |
|---|
Public Overridable Function OpenRead (
path As String,
type As FtpDataType,
restart As Long
) As Stream |
| Visual C++ |
|---|
public:
virtual Stream^ OpenRead(
String^ path,
FtpDataType type,
long long restart
) |
Return Value
Type:
StreamA stream for reading the file on the server
Implements
IFtpClient..::..OpenRead(String, FtpDataType, Int64)
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