无法使用C#SSH.NET更改目录
当我使用SSH.NET库连接到服务器时,默认文件夹是/ mif / stud3 / 2014 / rira1874.当我执行
res = ssh.CreateCommand("cd existingFolder").Execute();
Console.WriteLine(res);
它仍然保留在默认连接文件夹中.这有什么不对?
完整代码:
public void ConnectWithPassword(string username, string password, string domain, int port)
{
bool i = true;
using (var ssh = new SshClient(CreatePasswordConnectionInfo(username, password, domain)))
{
try
{
ssh.Connect();
if (ssh.IsConnected)
{
while(i == true)
{
string res = Regex.Replace(ssh.CreateCommand("pwd").Execute(), @"\r\n?|\n", "");
Console.Write(res + ": ");
res = ssh.CreateCommand(Console.ReadLine()).Execute();
Console.WriteLine(res);
}
}
else {
Console.WriteLine("Not connected");
}
ssh.Disconnect();
}
catch (Exception e)
{
Console.WriteLine("Exception caught: {0}", e);
}
}
}
...全文
相关推荐
C#SSH.NET开发官方chm帮助文档
SSH.NET是目前最为强大的C#.NET SSH Library类库,为了取代之前的SharpSSH而推出的,支持: NET3.5, NET4.0及以上, .NET Standard 1.3 Silverlight 4 Silverlight 5 Windows Phone 7.1 Windows Phone 8.0 Universal Windows Platform 10
SSH_Test.rar_C ssh_C#ssh_C++ ssh_C++ SSH_libssh2库
vs2010下实现的SSH上传功能,使用libssh2开源库编译
Granados基于.NET的SSH客户端库
Granados是一个基于.NET的SSH客户端库。它有以下特点: 1.Granados是一个C#的开源项目。 2.同时支持SSH1和SSH2。 3.Granados实现了AES, Blowfish, TripleDES, RSA, DSA等加密验证算法。 4.实现TCP协议连接。
mongodb-linux-x86_64-ubuntu2004-8.0.13.tgz
mongodb-linux-x86_64-ubuntu2004-8.0.13
chromedriver-linux64-159.0.8135.0(Canary).zip
chromedriver-linux64-159.0.8135.0(Canary).zip


其他技术讨论专区
