C#SSH.NET连接报错"value cannot be null All lists either null or empty"
来源:互联网 发布:短信免费发送软件 编辑:程序博客网 时间:2024/05/21 01:50
用网上找到的SSH.NET连接远程FTP主机,大致代码如下:
using Renci.SshNet;using Renci.SshNet.Common;Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);string user_Name = config.AppSettings.Settings["SSHUserName"].Value;string passWord = config.AppSettings.Settings["SSHpassword"].Value;string server_Ip = config.AppSettings.Settings["ftpServer"].Value;PasswordConnectionInfo sshConnectionInfo = new PasswordConnectionInfo(server_Ip, user_Name, passWord);SshClient cSSH = new SshClient(sshConnectionInfo);cSSH.Connect();SshCommand exec = cSSH.RunCommand("locate " + this.cbBoxName.Text);string All_result = exec.Result; // shell 返回结果是一个String
然后就在
cSSH.Connect();
这里报错,保存信息如下:
Value cannot be null or empty,All lists either null or emptyat Renci.SshNet.KeyboardInteractiveAuthenticationMethod.Authenticate(Session session)at Renci.SshNet.ConnectionInfo.Authenticate(Session session)at Renci.SshNet.Session.Connect()at Renci.SshNet.BaseClient.Connect()
解决方法,换上SSH.NET最新版本的dll,最新版本为2016.1.0-beta2,更新于2017年8月17日,下载链接:SSH.NET最新dll集合(2017年8月)。
阅读全文
0 0
- C#SSH.NET连接报错"value cannot be null All lists either null or empty"
- ASP.NET报错——Master Page frameworkName: Value cannot be null error
- 【报错】MySQLIntegrityConstraintViolationException:Column cannot be null
- React Native报Super expression error must either be null or a function错误分析
- hmset命令报错 value sent to redis cannot be null
- SSH框架问题——node to traverse cannot be null!报错问题
- For artifact {null:null:null:jar}: The groupId cannot be empty解决办法
- My Eclipse:Resources cannot be null报错
- hibernate报错:Column 'id' cannot be null
- Column name pattern can not be NULL or empty
- Content-Type为null报 'mediatype' must not be empty错
- Resources cannot be null
- Resources cannot be null
- Resources cannot be null
- Resources cannot be null
- Resources cannot be null
- string is null or empty
- Default value for column cannot be changed to NULL
- Mycat分库分表的简单实践 / 用Mycat,学会数据库读写分离、分表分库
- tomcat官网如何下载低版本的tomcat
- 将oracle字段,由varchar2类型变更为clob类型,报错
- MySQL索引实战汇总
- Linux 高级编程
- C#SSH.NET连接报错"value cannot be null All lists either null or empty"
- 使用android手机抓取windows的密码hash的实践
- python机器学习4—2代码详解及修改
- NAS与SAN架构:如何比较这两个存储系统?
- Pointers on C——9 Strings, Characters, and Bytes.5
- git忽略已经被提交的文件
- tomcat的一些优化
- 使用ssh在远程linux服务器上安装oracle
- Android Studio将library手动打成jar包