用于SSH和Telnet的C#库

时间:2021-01-22 15:18:53

I'm looking for a C# library that provides access to both SSH and Telnet under the same interface. What would be a good choice?

我正在寻找一个C#库,它可以在同一个界面下访问SSH和Telnet。什么是一个好的选择?

4 个解决方案

#1


9  

I recommend Granados for SSH stack. It has been used in many products.

我推荐使用Granados进行SSH堆栈。它已被用于许多产品中。

I recommend this code project page for telnet stack.

我推荐这个用于telnet堆栈的代码项目页面。

You can also download Poderosa terminal emulator. It's using Granados as the SSH stack and it has its own implementation of telnet stack.

您还可以下载Poderosa终端模拟器。它使用Granados作为SSH堆栈,它有自己的telnet堆栈实现。

Poderosa is very pluggable. It provides a good abstraction layer on the network stacks. If you don't have time to write your own unified interface, you should really check out their work. It provides access to both SSH and Telnet under the same interface like what you want. Unfortunately, it's written by Japanese engineers. All the inline comments are written in Japanese. It may take you some time to understand the codes.

Poderosa非常可插拔。它在网络堆栈上提供了一个很好的抽象层。如果您没有时间编写自己的统一界面,那么您应该查看他们的工作。它可以在相同的界面下提供对SSH和Telnet的访问,就像您想要的那样。不幸的是,它是由日本工程师编写的。所有内联注释都是用日语写的。您可能需要一些时间来理解代码。

You may also like to check out the terminal emulation library as well. Since you are going to process the data returning from the remote terminals, most terminals return escape character sequence for device control commands, font color/style or cursor movement commands.

您可能还想查看终端仿真库。由于您要处理从远程终端返回的数据,因此大多数终端返回设备控制命令,字体颜色/样式或光标移动命令的转义字符序列。

You may not notice that even in a simple command "ls -al", the returned content may also involve some escape character sequences. Those escape sequences are to make the directory name and file name shown in different colors.

您可能不会注意到即使在简单的命令“ls -al”中,返回的内容也可能涉及一些转义字符序列。这些转义序列是使目录名称和文件名以不同的颜色显示。

Again, for terminal emulation, the best C# library I can find is Poderosa. If you don't have to use C# library, PuTTY has the best terminal emulation support. It can recognize almost all escape character sequences I have seen so far.

同样,对于终端仿真,我能找到的最好的C#库是Poderosa。如果您不必使用C#库,PuTTY具有最佳的终端仿真支持。它可以识别我到目前为止看到的几乎所有转义字符序列。

Although I highly recommend you to look at Poderosa and Granados, please be aware that these projects seem to be no longer active. Well.. even so, it's still the best I have seen.

虽然我强烈建议你看看Poderosa和Granados,但请注意这些项目似乎不再活跃。好吧..即便如此,它仍然是我见过的最好的。

#2


3  

Making the SSH work with C# is indeed very tricky and most of the implementations are either buggy or too slow. When we were making SmarTTY, we struggled with SharpSSH and SSH.Net a lot, and then finally decided to make our own C# wrapper around libssh2.

使用C#进行SSH工作确实非常棘手,大多数实现都是错误或太慢。当我们制作SmarTTY时,我们经常与SharpSSH和SSH.Net进行斗争,然后最终决定在libssh2周围制作我们自己的C#包装器。

Although SmarTTY is not open-source, if you want to use its SSH library in your project, feel free to drop me an email. If there's a great demand for a library like that, we might release it as a separate product.

虽然SmarTTY不是开源的,但如果你想在你的项目中使用它的SSH库,请随时给我发电子邮件。如果对这样的库有很大需求,我们可能会将其作为单独的产品发布。

#3


2  

This link might help you C# Telnet Library

此链接可能会帮助您C#Telnet库

  • Minimalistic Telnet
  • 简约的Telnet
  • telnetcsharp.codeplex.com
  • telnetcsharp.codeplex.com
  • xpresslearn
  • xpresslearn
  • thoughtproject.com
  • thoughtproject.com
  • dotnettelnet
  • dotnettelnet

#4


0  

I couldn't find anything that provides identical (or even similar APIs) for both telnet and ssh, sharpSSH is a little library that nicely abstracts SSH.

我找不到任何为telnet和ssh提供相同(甚至类似的API)的东西,sharpSSH是一个很好地抽象SSH的小库。

#1


9  

I recommend Granados for SSH stack. It has been used in many products.

我推荐使用Granados进行SSH堆栈。它已被用于许多产品中。

I recommend this code project page for telnet stack.

我推荐这个用于telnet堆栈的代码项目页面。

You can also download Poderosa terminal emulator. It's using Granados as the SSH stack and it has its own implementation of telnet stack.

您还可以下载Poderosa终端模拟器。它使用Granados作为SSH堆栈,它有自己的telnet堆栈实现。

Poderosa is very pluggable. It provides a good abstraction layer on the network stacks. If you don't have time to write your own unified interface, you should really check out their work. It provides access to both SSH and Telnet under the same interface like what you want. Unfortunately, it's written by Japanese engineers. All the inline comments are written in Japanese. It may take you some time to understand the codes.

Poderosa非常可插拔。它在网络堆栈上提供了一个很好的抽象层。如果您没有时间编写自己的统一界面,那么您应该查看他们的工作。它可以在相同的界面下提供对SSH和Telnet的访问,就像您想要的那样。不幸的是,它是由日本工程师编写的。所有内联注释都是用日语写的。您可能需要一些时间来理解代码。

You may also like to check out the terminal emulation library as well. Since you are going to process the data returning from the remote terminals, most terminals return escape character sequence for device control commands, font color/style or cursor movement commands.

您可能还想查看终端仿真库。由于您要处理从远程终端返回的数据,因此大多数终端返回设备控制命令,字体颜色/样式或光标移动命令的转义字符序列。

You may not notice that even in a simple command "ls -al", the returned content may also involve some escape character sequences. Those escape sequences are to make the directory name and file name shown in different colors.

您可能不会注意到即使在简单的命令“ls -al”中,返回的内容也可能涉及一些转义字符序列。这些转义序列是使目录名称和文件名以不同的颜色显示。

Again, for terminal emulation, the best C# library I can find is Poderosa. If you don't have to use C# library, PuTTY has the best terminal emulation support. It can recognize almost all escape character sequences I have seen so far.

同样,对于终端仿真,我能找到的最好的C#库是Poderosa。如果您不必使用C#库,PuTTY具有最佳的终端仿真支持。它可以识别我到目前为止看到的几乎所有转义字符序列。

Although I highly recommend you to look at Poderosa and Granados, please be aware that these projects seem to be no longer active. Well.. even so, it's still the best I have seen.

虽然我强烈建议你看看Poderosa和Granados,但请注意这些项目似乎不再活跃。好吧..即便如此,它仍然是我见过的最好的。

#2


3  

Making the SSH work with C# is indeed very tricky and most of the implementations are either buggy or too slow. When we were making SmarTTY, we struggled with SharpSSH and SSH.Net a lot, and then finally decided to make our own C# wrapper around libssh2.

使用C#进行SSH工作确实非常棘手,大多数实现都是错误或太慢。当我们制作SmarTTY时,我们经常与SharpSSH和SSH.Net进行斗争,然后最终决定在libssh2周围制作我们自己的C#包装器。

Although SmarTTY is not open-source, if you want to use its SSH library in your project, feel free to drop me an email. If there's a great demand for a library like that, we might release it as a separate product.

虽然SmarTTY不是开源的,但如果你想在你的项目中使用它的SSH库,请随时给我发电子邮件。如果对这样的库有很大需求,我们可能会将其作为单独的产品发布。

#3


2  

This link might help you C# Telnet Library

此链接可能会帮助您C#Telnet库

  • Minimalistic Telnet
  • 简约的Telnet
  • telnetcsharp.codeplex.com
  • telnetcsharp.codeplex.com
  • xpresslearn
  • xpresslearn
  • thoughtproject.com
  • thoughtproject.com
  • dotnettelnet
  • dotnettelnet

#4


0  

I couldn't find anything that provides identical (or even similar APIs) for both telnet and ssh, sharpSSH is a little library that nicely abstracts SSH.

我找不到任何为telnet和ssh提供相同(甚至类似的API)的东西,sharpSSH是一个很好地抽象SSH的小库。