winscp-net

List files with specific extension using WinSCP .NET assembly

懵懂的女人 提交于 2019-12-08 02:49:39
问题 I am using WinSCP .NET assembly to do a download and upload through SFTP with C# .NET. I have the download function working but I am looking for a way to have the files in the remote server listed (or at least listed with a specific extension) so user only have to choose from those files with the specific extension (like .txt ) to get the files they want. Is there a way to do that with WinSCP .NET assembly? 回答1: Use the Session.ListDirectories method: RemoteDirectoryInfo directory = session

Get exe file into the build output directory

走远了吗. 提交于 2019-12-08 01:39:28
问题 Using WinSCP .NETassembly for SFTP support from a C# program. When building my project in Visual Studio, I would like WinSCP.exe and WinSCPnet.dll to be copied to the bin output directory. WinSCPnet.dll is easy enough - as its added as an assembly reference, just set "Copy Local" to true, and its done. But what about WinSCP.exe ? Two things I can think of: add the file WinSCP.exe to the root of the project, and set "Copy To Output Directory" to "Copy always" . in project properties Build

File transfer details binding continuously until file transfered in window using WPF

隐身守侯 提交于 2019-12-07 21:12:20
问题 I have created project to transferring file from client to server. I have done file transferred and got file transferred details such as file name (something.avi) and percentage (10%) of file transferred like below, Whenever I'm transferring a file, I'm using below event handler for knowing the file transferred details. private static void SessionFileTransferProgress(object sender, FileTransferProgressEventArgs e) { // New line for every new file if ((_lastFileName != null) && (_lastFileName

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

孤者浪人 提交于 2019-12-07 16:58:26
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. There's generally no way to hide any kind of credentials that (any) application possess from the end user. You can

A WinSCP script to download, rename, and move files

我们两清 提交于 2019-12-07 12:56:34
问题 Disclaimer #1: I posted this question on the WinSCP's forum but haven't received any replies and this issue is time-sensitive. Disclaimer #2: I'm basing the legitimacy of this cross-post on advice found on the subject from Meta. With that preamble... Up until now, I have been been using WS_FTP but would like to switch to WinSCP. I'm trying to convert this WS_FTP script into WinSCP: "C:\Program Files (x86)\Ipswitch\WS_FTP 12\wsftppro.exe" -s "sftp://USERNAME:PASSWORD@ftpus.pointclickcare.com

Getting “user defined type not defined” when trying to use WinSCP .NET assembly in VBA to upload file to SFTP

别说谁变了你拦得住时间么 提交于 2019-12-06 14:42:23
问题 I am trying to develop code for save the file in SFTP server but error in Session and showing error as user defined type not defined I am not sure below code working or not and I copied the code from internet source. Any suggestion would be appreciated. Sub test() Dim wb As Workbook Set wb = "D:\Ashok\Work\Loan_Input_Template V8-Library.xlsx" Dim mySession As New Session ' Enable custom error handling On Error Resume Next Call Upload(mySession, wb) ' Query for errors If Err.Number <> 0 Then

Get exe file into the build output directory

风格不统一 提交于 2019-12-06 10:55:13
Using WinSCP .NETassembly for SFTP support from a C# program. When building my project in Visual Studio, I would like WinSCP.exe and WinSCPnet.dll to be copied to the bin output directory. WinSCPnet.dll is easy enough - as its added as an assembly reference, just set "Copy Local" to true, and its done. But what about WinSCP.exe ? Two things I can think of: add the file WinSCP.exe to the root of the project, and set "Copy To Output Directory" to "Copy always" . in project properties Build Events , use post-build event command line to copy the file using command line copy command. Both seem a

List files with specific extension using WinSCP .NET assembly

核能气质少年 提交于 2019-12-06 04:41:49
I am using WinSCP .NET assembly to do a download and upload through SFTP with C# .NET. I have the download function working but I am looking for a way to have the files in the remote server listed (or at least listed with a specific extension) so user only have to choose from those files with the specific extension (like .txt ) to get the files they want. Is there a way to do that with WinSCP .NET assembly? Use the Session.ListDirectories method : RemoteDirectoryInfo directory = session.ListDirectory("/home/martin"); foreach (RemoteFileInfo fileInfo in directory.Files) { string extension =

File upload with WinSCP .NET/COM with temporary filenames

≡放荡痞女 提交于 2019-12-06 03:37:43
问题 I am creating a small .NET application in C# to upload files to an FTP Server. I am using the .NET DLL for WinSCP while doing this and i have been trying to find a good solution to my problem. The FTP folder where I will put all my files will be monitored by another application. This application will then take these files and process them automatically. So what I want to avoid is that my files are grabbed by the application before the transfer is complete. So I want to use either temporary

Powershell: Unable to find type when using PS 5 classes

本秂侑毒 提交于 2019-12-04 20:15:04
问题 I'm using classes in PS with WinSCP Powershell Assembly. In one of the methods I'm using various types from WinSCP. This works fine as long as I already have the assembly added - however, because of the way Powershell reads the script when using classes (I assume?), an error is throwed before the assembly could be loaded. In fact, even if I put a Write-Host at the top, it will not load. Is there any way of forcing something to run before the rest of the file is parsed? Transfer() { $this