简体   繁体   中英

How to add secure FTP capabilities to a .NET application

I'm rewriting an in-house client-server application as a .NET MVC application. It needs to send and receive files via secure FTP. The original application was client-server and used MOVEit Freely to do SFTP. Is there a library or product I can use to do it from within .NET?

If you don't want to pay anything, you can easily use the built-in FtpWebRequest for vanilla FTP and FTPES (explicit FTP with SSL). For FTPS (implicit FTP+SSL), I recommend Alex FTPS Client . And finally, for SFTP (FTP over SSH), you can use SharpSSH . This method isn't for everyone - it's really just for the cheap skate. But, I've been using this combo for all my data transfer needs in a production environment and it works great. The products are stale, but the protocols are stable, so who cares.

只需使用内置的FtpWebRequestFtpWebResponse类。

看看SharpSSH ,我知道他们支持sftp,不知道写服务器端会有多难。

我们的Rebex文件传输包支持安全FTP的两种变体 - SFTP和FTPS(FTP / SSL)。

Take a look at edtFTPnet/PRO , which offers full support for SFTP in .NET.

You might also want to take a look at CompleteFTP , which is a fast, compact SFTP server for Windows platforms (it also supports FTP and FTPS).

I might add that using the term "Secure FTP" can be rather confusing. It can mean SFTP, which is a secure file transfer protocol that runs over SSH. Or it can mean FTPS, which is basically standard FTP commands running over an SSL connection.

I was involved in creating MOVEit Freely. It never had support for SFTP over SSH - it only had support for FTP/S. Its original role was to be a "drop-in" command-for-command replacement of Microsoft's FTP.exe client - with extra support for SSL/TLS.

MOVEit Freely was originally built on top of a Dundas FTP/S stack, but we heavily modifed the original source code as FTP/S evolved. (We got in a bit early.) These days Dundas is focused on Dashboard components and the license agreement we signed with Dundas said that we'd never publish a standalone FTP/S component based on their code. (That's standard for that kind of OEM license.) In other words, I'd check out one of the Windows-based recommendations above. (I recommend components from \\n software, and also like the Rebex offering on Windows.)

This is native in .NET. The classes you want resides in the System.Net namespace. Take a look at FtpWebRequest and FtpWebResponse classes. Happy coding :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM