WinSCPHelper 1.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package WinSCPHelper --version 1.0.9                
NuGet\Install-Package WinSCPHelper -Version 1.0.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WinSCPHelper" Version="1.0.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WinSCPHelper --version 1.0.9                
#r "nuget: WinSCPHelper, 1.0.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install WinSCPHelper as a Cake Addin
#addin nuget:?package=WinSCPHelper&version=1.0.9

// Install WinSCPHelper as a Cake Tool
#tool nuget:?package=WinSCPHelper&version=1.0.9                

A library for uploading and downloading files from remote server via WinSCP Assembly Library. Extremely fast, flexible, and easy to use. WinSCPHelper works great on SFTP.

Getting Started

  • Right click on your project and select "Manage NuGet Package". Search for "WinSCPHelper". Install WinSCPHelper on your project.

  • Below is a sample code for downloading files from a remote directory to your local folder

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WinScpHelper;

namespace WinScpPlayground
{
    class Program
    {
        static void Main(string[] args)
        {
            WinScpWrapper winScpWrapper = new WinScpWrapper("hostname", "sftpusername", "sftppassword");
            var currentSession = winScpWrapper.CreateConnection();

            var currentList = winScpWrapper.DownloadFiles(currentSession, "/var/www/myremotedirectory",
                                        @"C:\mytargetfolder");

            //for verification - display names of downloaded file
            foreach (var file in currentList)
            {
                Console.WriteLine(file.FileName);
            }
        }
    }
}
  • You can also download a single file by doing this
WinScpWrapper winScpWrapper = new WinScpWrapper("hostname", "sftpusername", "sftppassword");
var currentSession = winScpWrapper.CreateConnection();
winScpWrapper.DownloadFiles(currentSession, "/var/www/myremotedirectory/remotefile.jpg", @"C:\mytargetfolder\localfile.jpg");
  • Here is a snippet in uploading files to your target remote directory
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WinScpHelper;

namespace WinScpPlayground
{
    class Program
    {
        static void Main(string[] args)
        {
            WinScpWrapper winScpWrapper = new WinScpWrapper("hostname", "sftpusername", "sftppassword");
            winScpWrapper.UploadFiles(currentSession, @"C:\localfolderforupload\*.*", "/var/www/myremotedirectory/*.*");
        }
    }
}
  • Uploading a single file is also doable. Like so,
WinScpWrapper winScpWrapper = new WinScpWrapper("hostname", "sftpusername", "sftppassword");
var currentSession = winScpWrapper.CreateConnection();
winScpWrapper.UploadFiles(currentSession, @"C:\localfolderforupload\localfile.jpg", "/var/www/myremotedirectory/remotefile.jpg");
  • That should be it.
Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on WinSCPHelper:

Package Downloads
Kurumin.Net.Ftp

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.13 71,554 12/3/2017
1.0.9 1,400 12/3/2017
1.0.8 1,549 12/2/2017

Essential features of this package is included. Basic downloading and uploading of files(SFTP) via WinSCP