本文介绍了尝试使用Renci.SsHNet进行SSH连接...任何人都做了请帮助我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是SSH连接新手并试图连接SSH连接,但它会抛出异常覆盖成员时违反了继承安全规则:'Renci.SshNet.Common.SshException.GetObjectData(System.Runtime.Serialization.SerializationInfo,System。 Runtime.Serialization.StreamingContext)'。重写方法的安全性可访问性必须与被覆盖的方法的安全性可访问性相匹配。它急了请帮帮我

I am new to SSH connection & trying to connect SSH connection but it throws an exception " Inheritance security rules violated while overriding member: 'Renci.SshNet.Common.SshException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden." Its urgent please help me

推荐答案

Quote:

SshClient sshClient = new SshClient( localhost,root,)



var terminal = sshClient.RunCommand(service mysqld restart);

var output = terminal.Result;

SshClient sshClient = new SshClient("localhost", "root", "")

var terminal = sshClient.RunCommand("service mysqld restart");
var output = terminal.Result;


这篇关于尝试使用Renci.SsHNet进行SSH连接...任何人都做了请帮助我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 10:57