美文网首页
C# Centos 使用类库收藏

C# Centos 使用类库收藏

作者: Net的搬运工 | 来源:发表于2018-05-25 10:38 被阅读15次

C#通过SharpSSH类库登陆远程linux服务器执行命令并得到回显

 public static string ssh(string ip, string root, string pass, string command)
 {

            SshStream ssh = new SshStream(ip, root, pass);
            ssh.Prompt = "#";
            ssh.RemoveTerminalEmulationCharacters = true; 
            string response = ssh.ReadResponse();
            ssh.Write(command);
            ssh.Flush();
            ssh.Write("/n");
            response = ssh.ReadResponse();
            //Console.WriteLine(response);
            return response;

  }

相关文章

  • C# Centos 使用类库收藏

    C#通过SharpSSH类库登陆远程linux服务器执行命令并得到回显

  • c#操作数据库类

    c#操作数据库类

  • SharpMap 轻型开源GIS

    SharpMap是一个基于.net 2.0使用C#开发的Map渲染类库,可以渲染各类GIS数据(目前支持ESRI ...

  • webgis学习

    新建一个c#类库 例如 namespace ClassLibrary1 { [ServiceContract(...

  • C#中类的成员类型简述

    C#语言作为应用程序的主要开发工具,使用也变得越来越广泛,而其中基于类库的思想也越发深入身心,而类作为对...

  • C#它山之石

    C# 使用反射技术实例化指定的类C#之玩转反射Reactive Extensions入门IoC solutions...

  • 跟诸子学游戏 Unity3d小技巧(杂项)

    1:C# https://www.nuget.org/ 第三方库 上面查找常用的类库,如json解析库litjso...

  • Ubuntu16.10 安装 Nginx

    关注我 安装 Nginx 依赖库 安装 gcc g++ 的依赖库 Ubuntu 平台使用: CentOS 平台使用...

  • 第六节 Linux安装Ngix

    1.开始前,请确认gcc g++开发类库是否装好,默认已经安装 centos平台编译环境使用如下指令 yum -y...

  • 安装

    Docker 支持 CentOS6 及以后的版本。 CentOS6 对于 CentOS6,可以使用 EPEL 库安...

网友评论

      本文标题:C# Centos 使用类库收藏

      本文链接:https://www.haomeiwen.com/subject/xheyjftx.html