winscp-net

WinSCP .NET assembly - How to set folder permissions after creating directory?

南楼画角 提交于 2019-12-23 04:01:08
问题 I'm building a web site and I want that when a user registers, to create a directory on the SFTP server and put in that directory a new file I'm using WinSCP .NET assembly, and writing C#. I noticed that you are able to set permissions only in the method: Session.PutFiles and not in the method: Session.CreateDirectory Snd so after I create the directory and put the file in it, I cannot access the file because I don't have permissions - I'm accessing the file with the full URL How can I access

How to securely deploy PPK file in WPF C# app?

我的梦境 提交于 2019-12-23 03:45:17
问题 I have a C# app that connects to a SFTP server to transfer log files. The app achieves this by using WinSCP .NET assembly to connect to the server. How do I securely store the .ppk private key file such that the user is not able to take this file to access the SFTP for themselves? http://winscp.net/eng/docs/library#csharp Based on the way the library reference the .ppk , it may not be possible to avoid storing the .ppk file on the local disk during run-time? Thanks in advance. 回答1: There's

How to get the files of remote directory using a pattern with C# and WinSCP

不羁岁月 提交于 2019-12-22 12:36:13
问题 I'm trying to get an specific files from a remote server with FTP/SFTP connection, the issue that I'm having is, I'm trying to get the count of files in the remote directory with an specific pattern. I'm using a mask but is not working for me, it throwing an exception: this is what I have DataFile.sRemoteDirectory = "/user/ftpuser/test/"; receivepattern = "Del*"; filesCount = session.ListDirectory( session.EscapeFileMask(DataFile.sRemoteDirectory + receivepattern)) .Files.Where(x => !x

SSH host key fingerprint does not match pattern C# WinSCP

人走茶凉 提交于 2019-12-22 07:03:13
问题 I am trying to connect to an FTPS server using C# via WinSCP and I am getting this error: SSH host key fingerprint ... does not match pattern ... After tons of research, I believe is has something to do with the length of the key. The key I got from WinSCP when connected using its interface under "Server and protocol information" is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx but the ones I saw in the example is shorter like this xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

SSH host key fingerprint … does not match pattern … when using WinSCP .NET assembly in C# to download files

烂漫一生 提交于 2019-12-21 23:00:38
问题 I'm writing a C# app (want to eventually create a Windows service if I can get this working) to download files from a server using SCP (I am limited to SCP as the only option). I am using the WinSCP .NET assembly (v 5.15.3). I have an SSH tunnel between my PC and the server, so the following works from the command line: ssh user:server I'm running in to a problem when setting the SshHostKeyFingerprint in my code. WinSCP.SessionOptions options = new WinSCP.SessionOptions(); options.HostName =

WinSCP .NET library: Connect to SFTP server without specifying SSH host key fingerprint

泪湿孤枕 提交于 2019-12-21 20:56:57
问题 In the current stable release of WinSCP, it seems that using SshHostKeyFingerprint is mandatory and there are no ways to connect to SFTP server without that in SessionOptions . I can see that the ability to bypass is added to the beta (5.2) but I was wondering whether or not it's possible to connect without this fingerprint. 回答1: First, make sure you understand that you give-up any security , when you try to bypass SSH host key check. You effectively lose a protection against man-in-the

SSIS C# 2012 Script Task referring WinSCPnet.dll fails when run from SQL Server Agent with “Exception has been thrown by the target of an invocation”

醉酒当歌 提交于 2019-12-18 06:50:53
问题 I have an SSIS package (created in VS 2013) that contains a C# 2012 Script Task. The job of the script task is to download a file from an SFTP server using WinSCP .NET assembly and place it on my server (Windows Server 2012 R2 with SQL Server 2014) My package runs fine when I run it on my Dev machine, but when I deploy to the server my package fails at this task with the error message Exception has been thrown by the target of an invocation I've done some digging and it looks like it has

Load picture from FTP to PictureBox with WinSCP .NET assembly

前提是你 提交于 2019-12-10 12:33:33
问题 I am using WinSCP .NET assembly to transfer files by FTP. Couple days ago I developed new module to show pictures in PictureBox control. What I would like to achieve is to list picture's paths inside listbox or whatever else and then when click on this path to be able to open the picture in PictureBox . The point is pictures are on remote location on my FTP and I have no idea is it possible using WinSCP (FTP) to use get their path and then using the paths to show up given picture inside

PowerShell runtime exception - “could not load file or assembly”

北城余情 提交于 2019-12-09 02:36:17
问题 This seems to be a common problem in PowerShell and Visual Studio, yet cases and solutions seem to vary a lot. Though seeing several similar questions, I didn't find a working solution for my issue yet. The problem exists in the error message Could not load file or assembly 'file:///C:\users\jenstmar\Desktop\WinSCP.dll' o r one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) The file location is invalid, as the .dll is supposed to be located in the same

Load/save documents to SFTP Linux server with VB.NET

拥有回忆 提交于 2019-12-08 10:32:14
问题 So I am using Visual Studio 2013 (Community) And so far I've build a program that can create files using textboxes and so forth. It saves to XML, and hopefully reads from XML (Even if I am getting access denied) The time has come for the Application to talk to a server, where all the files will be saved, and read from. The server is a Linux Server Edition (Latest) and its up and running fine. I want my application to connect to it, log in, and then just list and read files from the server. So