Dart.Ftp Namespace > Ftp Class > Get Method : Get(String,Int64,Stream) Method |
Public Overloads Function Get( _ ByVal remotePath As String, _ ByVal remoteOffset As Long, _ ByVal localDestination As Stream _ ) As CopyResult
Dim instance As Ftp Dim remotePath As String Dim remoteOffset As Long Dim localDestination As Stream Dim value As CopyResult value = instance.Get(remotePath, remoteOffset, localDestination)
public CopyResult Get( string remotePath, long remoteOffset, Stream localDestination )
public: CopyResult^ Get( String^ remotePath, int64 remoteOffset, Stream^ localDestination )
The destination Stream is not closed after use.
DataIsBusy returns true while this method executes.
/// <summary> /// Resumes (or starts) a Get operation /// </summary> /// <param name="myFtp">A connected and authenticated Ftp instance</param> /// <param name="remotePath">An absolute or relative path to the file on the server</param> /// <param name="localPath">The download location</param> /// <returns>The CopyResult of the operation</returns> public CopyResult RestartGet(Ftp myFtp, string remotePath, string localPath) { //Ensure that the Ftp object is in binary/image transfer mode myFtp.SetType(FileType.Image); //Create a new file, or open the existing file using (FileStream fs = File.OpenWrite(localPath)) { //Set the stream to the correct position fs.Position = fs.Length; //Start/resume the transfer, and (optionally) return the result return myFtp.Get(remotePath, fs.Position, fs); } }
''' <summary> ''' Resumes (or starts) a Get operation ''' </summary> ''' <param name="myFtp">A connected and authenticated Ftp instance</param> ''' <param name="remotePath">An absolute or relative path to the file on the server</param> ''' <param name="localPath">The download location</param> ''' <returns>The CopyResult of the operation</returns> Public Function RestartGet(ByVal myFtp As Ftp, ByVal remotePath As String, ByVal localPath As String) As CopyResult 'Ensure that the Ftp object is in binary/image transfer mode myFtp.SetType(FileType.Image) 'Create a new file, or open the existing file Using fs As FileStream = File.OpenWrite(localPath) 'Set the stream to the correct position fs.Position = fs.Length 'Start/resume the transfer, and (optionally) return the result Return myFtp.Get(remotePath, fs.Position, fs) End Using End Function