NET SFTP Library
SCPGetBinary(Stream,String,IFireProgress) Method
Example 






KellermanSoftware.NetSFtpLibrary Namespace > SFTP Class > SCPGetBinary Method : SCPGetBinary(Stream,String,IFireProgress) Method
A local file stream
The remote file name
Monitor the progress
Get a file using the SCP Protocol
Syntax
'Declaration
 
Public Overloads Sub SCPGetBinary( _
   ByVal localStream As System.IO.Stream, _
   ByVal remoteFileName As System.String, _
   ByVal fireProgress As IFireProgress _
) 
'Usage
 
Dim instance As SFTP
Dim localStream As System.IO.Stream
Dim remoteFileName As System.String
Dim fireProgress As IFireProgress
 
instance.SCPGetBinary(localStream, remoteFileName, fireProgress)
public void SCPGetBinary( 
   System.IO.Stream localStream,
   System.string remoteFileName,
   IFireProgress fireProgress
)
public procedure SCPGetBinary( 
    localStream: System.IO.Stream;
    remoteFileName: System.String;
    fireProgress: IFireProgress
); 
public function SCPGetBinary( 
   localStream : System.IO.Stream,
   remoteFileName : System.String,
   fireProgress : IFireProgress
);
public: void SCPGetBinary( 
   System.IO.Stream* localStream,
   System.string* remoteFileName,
   IFireProgress* fireProgress
) 
public:
void SCPGetBinary( 
   System.IO.Stream^ localStream,
   System.String^ remoteFileName,
   IFireProgress^ fireProgress
) 

Parameters

localStream
A local file stream
remoteFileName
The remote file name
fireProgress
Monitor the progress
Remarks
https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
Example
SFTP sftp = new SFTP(); //Trial Mode            
//SFTP sftp = new SFTP("place user name here", "place license key here");
 
// set the name of the SSH server( its URL )
sftp.HostAddress = "some.sftp.server.com"; // replace with your SFTP server
sftp.UserName  = "anonymus"; // replace with your user name
sftp.Password = "user@mail.com"; // replace with your password
 
using (FileStream fileStream = new FileStream("a.txt", FileMode.Create, FileAccess.Write))
{
    sftp.SCPGetBinary(fileStream, "a.txt", null);
}
Dim sftp As New SFTP() 'Trial Mode
'Dim sftp = New SFTP("place user name here", "place license key here")
 
' set the name of the SSH server( its URL )
sftp.HostAddress = "some.sftp.server.com" ' replace with your SFTP server
sftp.UserName = "anonymus" ' replace with your user name
sftp.Password = "user@mail.com" ' replace with your password
 
Using fileStream As New FileStream("a.txt", FileMode.Create, FileAccess.Write)
    sftp.SCPGetBinary(fileStream, "a.txt", Nothing)
End Using
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SFTP Class
SFTP Members
Overload List