简体   繁体   English

Rencii SSH.NET Shell

[英]Rencii SSH.NET Shell

I am trying to write a terminal app using Shell class from Rencii SSH.NET lib. 我正在尝试使用Rencii SSH.NET lib中的Shell类编写终端应用程序。 Here is my code. 这是我的代码。

var input = Console.OpenStandardInput();
var output = Console.OpenStandardOutput();

var shell = sshClient.CreateShell(input, output, output);
shell.Start();

All goes well, except one thing. 一切顺利,除了一件事。 When I enter command, it sends an extra newline. 当我输入命令时,它会发送一条额外的换行符。 How can I dispose of that? 我该如何处置?

I have tried really hard to creating ssh shell from this and tried to find shell controls for wpf but I wasnt successful untill I used this library 我已经非常努力地从中创建ssh shell,并尝试找到wpf的shell控件,但是直到我使用了这个库,我才获得成功

http://www.codeproject.com/Articles/13422/Terminal-Control-Project-C-VT-SSH-Telnet http://www.codeproject.com/Articles/13422/Terminal-Control-Project-C-VT-SSH-Telnet

and it works well with wpf and as it is developed in windows form so would be really easy to implement. 并且它与wpf一起使用时效果很好,并且它以Windows形式开发,因此非常容易实现。 you need to import namespace and import the custom control from dll file and for wpf import namespace 您需要导入名称空间并从dll文件导入自定义控件,对于WPF导入名称空间

xmlns:terminalControl="clr-namespace:WalburySoftware;assembly=TerminalControl"

xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"   
and the control

<WindowsFormsHost Panel.ZIndex="6">

<terminalControl:TerminalEmulator   x:Name="TerminalEmulator" Hostname="192.168.x.x" Password="root" Username="root" ConnectionType="SSH2"></terminalControl:TerminalEmulator>  

</WindowsFormsHost>

and from code behind call the TerminalEmulator.Connect() and you have the terminal control in windows form or wpf 并从后面的代码中调用TerminalEmulator.Connect(),您就可以使用Windows窗体或wpf的终端控件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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