有没有好的免费 .Net 网络库?(FTP、SFTP、SSH 等)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/153220/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 10:10:00  来源:igfitidea点击:

Are there any good free .Net network libraries? (FTP, SFTP, SSH, etc.)

.netopen-sourceftpsshsftp

提问by Kilhoffer

I'm a bit surprised I haven't found a good open source library for performing common network tasks. There are a few very good commercial libraries, but they're too expensive to use on an open source project.

我有点惊讶我还没有找到一个很好的开源库来执行常见的网络任务。有一些非常好的商业库,但是在开源项目中使用它们太昂贵了。

Anyone know of any?

有谁知道吗?

回答by Michael

SSH.NET Library - https://github.com/sshnet/SSH.NET

SSH.NET 库 - https://github.com/sshnet/SSH.NET

Inspired by Sharp.SSH, this library is complete rewrite using .NET 4.0, without any third party dependencies and utilizes parallelism as much as possible to allow best performance.

受 Sharp.SSH 的启发,该库使用 .NET 4.0 完全重写,没有任何第三方依赖项,并尽可能利用并行性以实现最佳性能。

It's been a solid C# implementation of client side SSH.

它是客户端 SSH 的可靠 C# 实现。

回答by Gabriel

.Net ships with some basic FTP support via System.Net.FtpWebRequest, but its a bit crude at best. A far superior alternative that I can recommend is dotNET FTP client from sourceforge.

.Net 通过 System.Net.FtpWebRequest 提供了一些基本的 FTP 支持,但充其量有点粗糙。我可以推荐的一个更好的替代方案是sourceforge 的 dotNET FTP 客户端

I don't know if you're looking for email libraries too, but its something that I came across, so I'll mention it.

我不知道您是否也在寻找电子邮件库,但它是我遇到的东西,所以我会提到它。

For email composing and delivery, the basic .NET libraries are fine. System.Net.Mail.MailMessage is great for composing emails, and System.Net.Mail.SmtpClient is good for sending emails over SMTP.

对于电子邮件撰写和交付,基本的 .NET 库就可以了。System.Net.Mail.MailMessage 非常适合撰写电子邮件,而 System.Net.Mail.SmtpClient 非常适合通过 SMTP 发送电子邮件。

For retrieving emails with POP3 and parsing MIME messages, you will want an external library. I've been using POP3 MIME Clientfrom codeproject without any problems.

为了使用 POP3 检索电子邮件和解析 MIME 消息,您需要一个外部库。我一直在使用codeproject 的POP3 MIME Client,没有任何问题。

I hope that helps!

我希望这有帮助!

回答by jeffm

edtFTPNetis free, but you have to buy their "Pro" version to get SFTP (FTP over SSH) and FTPS (FTP over SSL).

edtFTPNet是免费的,但您必须购买他们的“专业版”才能获得 SFTP(基于 SSH 的 FTP)和 FTPS(基于 SSL 的 FTP)。

回答by Ray Li

Although it hasn't been updated in a while, it is free! I remember being able to get SharpSSH to run without much hassle, and it supports port forwarding (which is what I was looking for at the time!).

虽然已经有一段时间没有更新了,但它是免费的!我记得能够让 SharpSSH 轻松运行,并且它支持端口转发(这是我当时正在寻找的!)。

SharpSSH http://www.tamirgal.com/home/dev.aspx?Item=SharpSsh

SharpSSH http://www.tamirgal.com/home/dev.aspx?Item=SharpSsh

回答by Jeff

It's not a single library, and I'm not sure how good they are but I was able to find a couple of links to open source libraries here:

它不是一个单一的库,我不确定它们有多好,但我能够在这里找到几个指向开源库的链接:

http://csharp-source.net/open-source/network-clients

http://csharp-source.net/open-source/network-clients

Hope this helps! Jeff

希望这可以帮助!杰夫

回答by Mauricio Scheffer

Lumisoftis open source and has FTP, DNS, IMAP, POP3 clients, among other stuff. It doesn't include SSH and SFTP though.

Lumisoft是开源软件,拥有 FTP、DNS、IMAP、POP3 客户端等。但它不包括 SSH 和 SFTP。

回答by AJ.

In practice, the only place where I currently do SFTP, I use putty'sbundled psftp utility, and run it from a process object. That may not be great, but it's working reliably for me.

在实践中,我目前唯一使用 SFTP 的地方是使用putty捆绑的 psftp 实用程序,并从进程对象运行它。这可能不是很好,但它对我来说很可靠。

回答by ZombieSheep

IIRC, FTP is built in to .NET, (System.Net.FtpWebRequest) and last time I looked (a couple of years ago, admittedly) I couldn't find any free SSH / SFTP assemblies. That might have changed, though.

IIRC,FTP 内置于 .NET,(System.Net.FtpWebRequest),上次我看(几年前,诚然)我找不到任何免费的 SSH/SFTP 程序集。不过,这可能已经改变了。

回答by Robert S.

I did some research and found an implementation of SSH in C#, called sharpSsh. It is a port of the Jsch (Java Secure Channel) library for Java. We use Jcsh here at my employer, and it's great. I can't vouch for the C# version.

我做了一些研究,并在 C# 中找到了一个 SSH 实现,称为sharpSsh。它是 Java 的 Jsch(Java 安全通道)库的一个端口。我们在我的雇主这里使用 Jcsh,它很棒。我不能保证 C# 版本。