This article is a mirror article of machine translation, please click here to jump to the original article.

View: 57917|Reply: 5

[Source] C# interacts with the SFTP server to upload and download SFTP upload SFTP download

[Copy link]
Posted on 12/29/2018 12:23:55 PM | | | |
This post was last edited by sgFengSu on 2019-1-1 10:51

The previous post did not add SFTP to it, so I wrote it separately here
C# itself is a class or method that does not interact with SFTP, and you need to reference SSH.NET class library GitHub SHH.NET download address https://github.com/sshnet/SSH.NET
This is the latest, if the download from other places is not easy to use, you can first see if it is a version problem, and the project itself is. .NET 4.0 requires a dll that supports 4.0
The contents of the downloaded file are shown in the figure

Then you can build your own class, many people have written it, you can search for it, and then I will upload it on the attachment (it was also written by someone else, I forgot where I downloaded it from). Whether uploading or downloading, you need to connect first, and then close the connection.
PS:SFTP默认端口 22
Oh, by the way, there is a difference between SFTP and FTP, don't confuse it. There is an extra S(SecureSecurity, compared to FTP, SFTP is more secure, but what is more secure is the sacrifice of performance, and the transfer rate will be slower.
As long as SSH is enabled on the linux system, SFTP is also available, and there is no need to install it, while FTP needs to be installed separately
When uploading UploadFile, the following upload directory is the SFTP server folder directory + the name of the file to be uploaded.
Source code download:
Tourists, if you want to see the hidden content of this post, pleaseReply





Previous:Office full set of learning materials (worth 5,000 yuan)
Next:C# controls the maximum number of parallels for multiple threads
Posted on 12/31/2018 11:12:31 AM |
I have learned, and I have been working on FTP upload and download functions some time ago.
Posted on 12/31/2018 3:50:58 PM |
C# interacts with the SFTP server to upload and download SFTP upload SFTP download, kanakn
Posted on 7/18/2019 3:26:34 PM |
Thanks for the supply
Posted on 8/29/2019 6:07:31 PM |
Just needed, look at learning and learning
Posted on 6/12/2021 11:40:26 AM |
I found many ways to hope this works
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com